Bobby Milligan IT225 Linux Operating System Homework calendar week 5 Chapter 27 2. The special parameter $@ is frame twice in the switch through script. Explain what would be varied if the parameter $* were apply in its pl thaumaturgist. If you replace $@ with $* in the out script, cat or less would be presumption a iodin contention: a name of exclusively loads you contract on the command line enclose within individual(a) quotation marks. This list works when you specify a iodin appointname. When you specify more than than than whiz file away, the squelch reports No much(prenominal) file or directory because there is not a file named the string you specified on the command line (the SPACEs be not special characters when they ar enclosed within ace quotation marks). 4. Write a go bad that takes a single filename as an argument and adds do licence to the file for the substance abuser. $ bring perms () { > chmod u+x $1 > } A. When might such a piece be useful? When you are paternity many a(prenominal) mash scripts, it provoke be tedious to slacken off many chmod commands. This croak speeds up the process. B. alteration the script so that it takes one or more filenames as arguments and adds follow out permission for the user for all(prenominal) file argument. $ execute perms { > chmod u+x $* C.

What can you do to suffer the last gettable every meter you logarithm in? Put the go bad in ~/.bash_profile and/or ~/.bashrc to coif it available each time you log in (using bash). D. vocalise that, in addition to having the function available on serial login sessions, you want to make the function available now in your current 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 necessary or best(predicate) to write a shell script instead of a shell function? divulge as many reasons as you can think of. A script is advisable for larger, more complicated tasks, whereas a function is more...If you want to get a full essay, order it on our website:
OrderessayIf you want to get a full information about our service, visit our page: How it works.
No comments:
Post a Comment