Bobby Milligan IT225 Linux Operating System Homework Week 5 Chapter 27 2. The special parameter $@ is pen twice in the come out through book of account. Explain what would be varied if the parameter $* were employ in its place. If you replace $@ with $* in the out hired hand, cat or less would be given a iodin object: a advert of all loads you contract on the command line enclosed within individual(a) quotation marks. This list works when you specify a iodin appointname. When you specify more than one charge up cabinet, the squelch reports No much(prenominal) file or directory because thither is not a file named the string you specified on the command line (the SPACEs be not special characters when they be enclosed within ace quotation marks). 4. Write a go bad that takes a single filename as an argument and adds do permission to the file for the user. $ bring perms () { > chmod u+x $1 > } A. When might such a solve be useful? When you are writing many a(prenominal) bunk scripts, it can be tedious to give many chmod commands. This get speeds up the process. B. Revise the script so that it takes one or more filenames as arguments and adds execute permission for the user for all(prenominal) file argument. $ function perms { > chmod u+x $* C.
What can you do to converge the function open every time you logarithm in? Put the function in ~/.bash_profile and/or ~/.bashrc to make it available each time you log in (using bash). D. enunciate that, in addition to having the function available on ensuant login ses! sions, you deprivation to make the function available now in your catamenia shell. How would you do so? Use source to execute the file you put the function in, for example, $ source ~/.bash_profile 5.) When might it be demand or advisable to write a shell script instead of a shell function? attain as many reasons as you can think of. A script is advisable for larger, more complicated tasks, whereas a function is more...If you compulsion to get a full essay, order it on our website: OrderCustomPaper.com
If you want to get a full essay, visit our page: write my paper
No comments:
Post a Comment