(Solved):How would you execute a script named test script from the command line? (a) ./testscript (b) run testscript (c) exec testscript (d) testscript. View Answer…

 

Question

How would you execute a script named test script from the command line?

(a) ./testscript

(b) run testscript

(c) exec testscript

(d) testscript.

 

EXPERT ANSWER

Answer: To execute a script named testscript from the command line we use (a) ./testscript command.

Steps to write and execute a script:

  • Open the terminal. Go to the directory where you want to create your script.
  • Create a file with testscript.sh (.sh extension)
  • Write the script in the file using an editor.
  • Make
Scroll to top