how do I run a shell command?
Hi,
I am so new to this UNIX. I am trying to do some practice by using Linux book but confused with it. Here is the one I am trying to practice:
Copy the following shell that completes the following:
#!/bin/bash
echo Select a country from the following list:
echo America, Italy, France, Germany
read country
case $country in
[Aa]merica ) echo Ford; echo Perhaps;;
[Ii]taly ) echo Ferarri;echo no;;
[Ff]rance ) echo Peugeot ;echo no way;;
[Gg]ermany ) echo Porsche ;echo yes;;
esac
Run the shell from above.
I DID THAT. PLEASE SEE BELOW:
ubuntu@ubuntu:~$ #!/bin/bash
ubuntu@ubuntu:~$ echo Select a country from the following list:
Select a country from the following list:
ubuntu@ubuntu:~$ echo America, Italy, France, Germany
America, Italy, France, Germany
ubuntu@ubuntu:~$ read country
ubuntu@ubuntu:~$ case $country in
> [Aa]merica ) echo Ford; echo Perhaps;;
> [Ii]taly ) echo Ferarri; echo no;;
> [Ff]rance ) echo Peugeot; echo no way;;
> [Gg]ermany ) echo Porsche; echo yes;;
> esac
ubuntu@ubuntu:~$
BUT I STOP AS I DON'T KNOW HOW WILL I RUN IT, CAN YOU PLEASE HELP? ALSO, ANOTHER QUESTION IS HOW DO I SAVE IT? I DON'T SEE ANY SAVE ICON FROM THE TERMINAL I OPENED.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- marcobra (Marco Braida)
- Solved:
- Last query:
- Last reply:
This question was reopened
- by pham