Shell Scripting First Lab: Create First Shell Script

Hi All ,

Lab: Creating your first shell script

I have created a shell script and added the commands ( PFA image ) . Still the task is failing. Can someone guide me as why this is failing ?

Thanks,
Rakesh

1 Like

Hello, Raki3101
Have you still facing the issue?

You need to read the instructions again, your script is named slightly differently to what it has asked you to create (you have added a bit that is not needed)

Thanks Rosarch. I got it what the mistake is. I need to save it as a command without .sh extension to the script.

Same lab not working for. Appreciate your help.

ob@caleston-lp10:~$ cat create-and-launch-rocketcat: create-and-launch-rocket: No such file or directory
bob@caleston-lp10:~$ cat create-and-launch-rocket.sh
cat: create-and-launch-rocket.sh: No such file or directory
bob@caleston-lp10:~$
bob@caleston-lp10:~$ echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
bob@caleston-lp10:~$ export PATH=$PATH:/home/bob
bob@caleston-lp10:~$ which create-and-launch-rocket
bob@caleston-lp10:~$ which create-and-launch-rocket
bob@caleston-lp10:~$

This lab is not working for me. I tried it couple of times per instruction. Appreciate your help.

Hello, @Jhasujay
I think you are doing wrong way. You have to use vi editor to write command into the file create-and-launch-rocket.
First you can create file with the touch command.

touch create-and-launch-rocket

then use vi editor.

vi create-and-launch-rocket

OR
You can use direct vi editor.

vi create-and-launch-rocket

Hope it will help.

1 Like

Thank you for your quick response. It worked. I am new to Linux/Shell scripting …:slight_smile: