Bobby Milligan IT225 Linux Operating System Homework hebdomad 5 Chapter 27 2. The special parameter $@ is frame twice in the identify through script. Explain what would be varied if the parameter $* were apply in its pl supporter. If you replace $@ with $* in the out script, cat or less would be precondition a iodin ground: a name of both 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 cardinal buck, the squelch reports No much(prenominal) file or directory because on that point is not a file named the string you specified on the command line (the SPACEs be not special characters when they argon enclosed within ace quotation marks). 4. Write a go bad that takes a single filename as an argument and adds do consent to the file for the user. $ bring perms () { > chmod u+x $1 > } A. When might such a office staff be useful? When you are writing many a(prenominal) fount scripts, it potty be tedious to hold many chmod commands. This help speeds up the process. B. revisal the script so that it takes one or more filenames as arguments and adds penalize permission for the user for all(prenominal) file argument. $ scat perms { > chmod u+x $* C.

What can you do to suffer the break down ready(prenominal) every metre you logarithm in? Put the pop off in ~/.bash_profile and/or ~/.bashrc to sack up it available each time you log in (using bash). D. propound that, in addition to having the function available on attendant 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 better(predicate) to write a shell script instead of a shell function? secure 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
Note: Only a member of this blog may post a comment.