What are the different methods available to run a shell
script?

Answers were Sorted based on User's Feedback



What are the different methods available to run a shell script?..

Answer / keerthi

3 ways

1. sh scriptname.sh

2. If the script has execute permission -

./script.sh


3. If the script has execute permission and is
stored in the directory listed in PATH ----

script.sh or .script.sh

Is This Answer Correct ?    13 Yes 0 No

What are the different methods available to run a shell script?..

Answer / sujitha

3 ways

1. Execute Shell Script using File name

$./scriptfile { The changes in the script effect to current
terminal }

2 . Execute Shell Script by specifying the interpreter

$sh scriptfile

3. Execute Shell script using ../ (dot space dot slash)

$. ./scriptfile { The changes in the script effect to total
system }

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What does .sh file contain?

0 Answers  


What is gui scripting?

0 Answers  


Given a file find the count of lines containing the word "abc".

0 Answers  


how to get part of string variable with echo command only?

0 Answers  


What's the difference between scripting and coding?

0 Answers  






What does echo mean in scripting?

0 Answers  


What is web script?

0 Answers  


What is batch file programming?

0 Answers  


What is sudo command?

0 Answers  


What is the command to find out today's date?

0 Answers  


Is shell scripting easy to learn?

0 Answers  


I have 2 files and I want to print the records which are common to both.

0 Answers  


Categories