1Z0-821 practice question 21 of 30

You are the administrator for a group of shell script developers. They use vi, and have asked you to make their scripts automatically executable when they save their files. How can this be accomplished?

Full set: 243 questions
Answer options
A: Enter set –o vi on the command line, or include it in each user's startup script.
B: Enter umask –s on the command line, or include it in each user's startup script.
C: Enter umask 000 on the command line, or include it in each user's startup script.
D: Enter umask 777 on the command line, or include it in each user's startup script.
E: It is not possible to automatically set the execute bit on with the umask setting, or vi option. Correct answer
F: Enter umask 766 the command line, or include it in the global startup script for the default shell.
Correct Answer:
E. It is not possible to automatically set the execute bit on with the umask setting, or vi option.
Explanation

Unlike DOS, which uses the file extension to determine if a file is executable or not, UNIX relies on file permissions. The value assigned by umask is subtracted from the default. User's file creation mask. umask sets an environment variable which automatically sets file permissions on newly created files. i.e. it will set the shell process's file creation mask to mode. umask 000 would grant full permissions.
Note: 777 full permissions

Scroll to Top