Class 17 Flashcards
What is the value of the file descriptor for Standard Input?
0
What is the value of the file descriptor for Standard Output?
1
What is the value of the file descriptor for Standard Error?
2
If you wanted to run the executable file backup in your current directory, but wanted the error messages to disappear, what would you write at the command line?
./backup 2> /dev/null
If you wanted to run the executable file backup in your current directory, but wanted both the output and the error messages to go to the file results.txt, what would you write at the command line?
./backup &> results.txt
What would you type at the command line, if you wanted to make the script cheer.sh executable?
chmod 755 cheer.sh
Write the hashbang line we use for scripts in this course.
! /bin/bash
Write the hashbang line you would use if you wanted a script to run using the sh shell.
! /bin/sh
Name the three categories of people who might need to read a shell script.
the person who wrote the script, the persons who use the script and the person who maintains the script
What command would you use to make the changes you made in the startup file for your login shell take effect?
source .bash_profile