SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 21 Dec 2017 My Price 8.00

C++ file and there are three calls to a function

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:

  1. Move to the first line in the file from wherever you are (two keystrokes): ______
  2. start a forward search: ______
  3. Type "myFunction(" and hit <RETURN>
  4. Cursor should be at the start of a call to the function.
  5. Change from where the cursor is to the '(' character (three keystrokes): ______
  6. Type "my_function(" and hit <ESC>
  7. Repeat the last search (one keystroke): ______
  8. Repeat the last change (one keystroke): ______
  9. Repeat the last search (one keystroke): ______
  10. Repeat the last change (one keystroke):______

 

2.What flag will cause declare to "export" the variable being defined? 

Notes: 

  1. declare is a built-in function, so you will have to look in the man page for BASH for its usage.
  2. Testing: once a variable is "exported" it will show up in the output of the env command. env | grep myVa

__________________

 

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

  1. 1st blank is needed for command substitution
  2. 2nd blank is the flags needed for grep (include the leading - in your answer)
  3. Testing: create a sample file (not in the /var/log/httpd directory) with a known number of lines with different ERROR / error strings.

 

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:

  1. use an absolute mode for this question
  2. Testing: try some different chmod commands and use ls -l myScript.sh to check the result

 

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:

  1. 1st blank is the format string
  2. 2nd blank is a variable
  3. Testing: try it out

 

8.What is the test command to determine if var1 is greater than var2?

[ _______ ____________ __________   ]

Notes

  1. 1st blank is a variable
  2. 2nd blank is a test argument
  3. 3rd blank is a variable
  4. Testing try it out

 

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:

  1. 1st blank is a test flag
  2. 2nd argument is part of the if-statement
  3. Testing create a simple script and try it out

Answers

(5)
Status NEW Posted 21 Dec 2017 02:12 PM My Price 8.00

-----------  ----------- 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

Not Rated(0)