Stuck at 3.2.1 Passing parameters to a bash script

  1. After typing ./
    what should I do next, in order to see the script?

  2. How do we see /home/simulations/ on Explorer? I can only see USER ?

  3. Where can we find the files: | | move



Hi @MarkSix11,

Welcome to our community.

This error message happens because the script is expecting to have an argument.

In other words, you called ./, but instead, you should call:

./ rotate

and then, after stopping the command above using CTRL+C, you could:

./ stop

This is basically the reason why you see this error message.

But I agree that the script has to be improved.

If you replace all $ARG1 in the code with "$ARG1", then this error also would be gone.

I agree that we should have put the commas in the script, or put an error message in case the user does not provide an argument.

I think this could also be a good exercise for you, what do you think?

You could replace the first lines with:



if [ "$ARG1" == "" ]; then 
    echo "Please, provide an argument. E.g.: ./ rotate"
    exit 1

Then the code will detect when someone calls the script without an argument.

Keep pushing your Linux learning.

Thanks Ralves.

The commands, such as ./ rotate, ./demo sh stop, and terms such as “argument” are not taught before moving on to work on the scripts in 3.2.1. What are the usage of those commands? Are there other Bash commands that I need to learn before working on the scripts?

Overall the materials are easy to follow until Section 3.2.1 where I start getting lost. I feel that I may have missed something after Exercise 3.3. but before Section 3.2.1. Can you help?


Hi @MarkSix11 ,

the “arguments” are defined inside the file itself. You, as the creator of a bash script, is the one who defines the arguments it accepts.

Let’s for example see the script below (let’s put the content below in a file named

#! /bin/bash


if [ "${argument}" == "marksix11" ]; then 
	echo "Congratlations, you passed the right argument."
	echo "[Error]: Provided argument '${argument}' is not the expected one."

If you just call it without arguments with ./, it will print:

[Error]: Provided argument ‘’ is not the expected one.

If you pass “rotate” as argument, ./ rotate, it will print:

[Error]: Provided argument ‘rotate’ is not the expected one.

If you then max “marksix11” as argument, ./ marksix11, it will say you passed the correct argument:

Congratlations, you passed the right argument.

In this example, the script was expecting marksix11 as argument. It could be anything.

Please let me know if you still have some questions, but I aggree that we have to improve this script.

Hi Ralves,

Thanks so much for your explanations. Very helpful :+1:

I now understand the bash syntax better, and completed Ex.3.4 with ease :tada:

With regards,

1 Like