Write a function that takes a single filename as an argument and adds execute permission to the file for the user.

$ function perms () {
> chmod u+x $1
> }

a. When might such a function be useful?
b. Revise the script so it takes one or more filenames as arguments and adds
execute permission for the user for each file argument.
c. What can you do to make the function available every time you log in?
d. Suppose that, in addition to having the function available on subsequent
login sessions, you want to make the function available in your current
shell. How would you do so?


a, When you are writing many shell scripts, it can be tedious to give many
chmod commands. This function speeds up the process.
b. $ function perms () {
> chmod u+x $*
> }
c. Put the function in ~/.bash_profile and/or ~/.bashrc to make it available
each time you log in (using bash).
d. Use source to execute the file you put the function in. For example:
$ source ~/.bash_profile

Computer Science & Information Technology

You might also like to view...

To prevent modification of a built-in array’s values when you pass the built-in array to a function:

a. The built-in array must be declared static in the function. b. The built-in array parameter can be preceded by the const qualifier. c. A copy of the built-in array must be made inside the function. d. The built-in array must be passed by reference.

Computer Science & Information Technology

When the ________ property in a form is set to Yes, the Navigation Pane collapses when the form is opened

A) validation rule B) Modal C) Caption D) Required

Computer Science & Information Technology

You view a portion of a document on the screen through a document ____________________, like the one in the accompanying figure.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Exit animation effects cause an object to leave the slide. _________________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology