bash - Write a script which prints all 10 arguments which have been passed to it. UNIX TERMINAL -


Hi guys, I am trying to answer the following question, but having a hard time trying to solve it:

Write a script that prints all 10 arguments that have passed it. Once the script has printed the arguments, the arguments were changed to 2 and print them again

This is my code

  #! / Bin / sh Echo "\ $ 1 now $ 1" resonance shifts "\ $ 2 now $ 2" echoing change "$ 3 is now $ 3" ​​echo "$ 4 is now $ 4" echo "\ $ 5 now $ 5 "echo" $ 6 is now $ 6 "echo" $ 7 is now $ 7 "echo" $ 8 is $ 8 now "echo" $ 9 is $ 9 now "echo" $ $ 10 $ {10} " 

And here is my code in Unix terminal

  #! Bin / sh echo "change $ $ 1" now $ 1 "change" is "$ 2 now $ 2", "$ 3 now $ 3" ​​$ 4 is now $ 4 "echo" $ $ $ 5 5 "echo" $ 6 is now $ 6 "echo" $ 7 is now $ 7 "echo" $ 8 is $ 8 now "echo" $ 9 is $ 9 now "echo" $ $ 10 $ {10} " 

thanks

the easiest way < I am in "$ @" in / p>

  x = 0; Does echo "\ $$ ((++ x) is $ i"; Shift shift for me in "$ @" x = 0; Do echo "\ $$ ((++ x) is now $ i;  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Algorithm negotiation fail SSH in Jenkins -

java - Messages from .properties file do not display UTF-8 characters -