The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Bash script problem
1.Assume you are editing a C++ file and there are three calls to a function with the following signature:
void myFunction(int x);
The function name has changed, so it is now called:
void my_function(int x);
Please take the following steps to make the necessary changes:
Â
2.What flag will cause declare to "export" the variable being defined?Â
Notes:Â
__________________
Â
3.What is the command that will set the variable numErrors equal to the number of lines in the file /var/log/httpd/error_log that contain the string ERROR (case insensitive: Error, error, eRROr, etc. also count)?
numErrors________=Â Â (grep_________Â Â ERROR /var/log/httpd/error_log)
Notes
Â
4.What is the command to use if you want to run a script without creating a new process?
Testing: create a script that sets a variable. If you have this right, that variable will be set in the calling shell.
_________________
Â
5.What is the special first line of a script that is to be directly executable by the shell?
______________________
Â
6.What is the command that will make the script file myScript.sh readable by all users, and writable and executable by the owner?
chmod_________myScript.sh
Notes:
Â
7.What is the command to print the number of command line arguments? The printed value should be formatted as 3 digits, with zero padding and a trailing newline.
printf "______"__________Â
Notes:
Â
8.What is the test command to determine if var1 is greater than var2?
[Â _______ ____________ __________Â Â Â ]
Notes
Â
9.What is the if-statement that will print a message if Hello.class is older than Hello.java?
if [ Hello.java________Hello.class ]
________________
echo "Hello.class is out of date"
fi
Notes:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly