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

c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l

0 Answers  


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

0 Answers  


Why do we use shell scripting?

0 Answers  


How to print the first array element?

0 Answers  


Is bash a shell script?

0 Answers  






What is an inode block?

0 Answers  


How will you emulate wc –l using awk?

0 Answers  


write a shell script that accepts name from user and creates a directory by the path name, then creates a text file in that directory and stores in it, the data accepted from user till STOP, displays the no. of characters stored in the file.Program stops if directory name is null

1 Answers  


How can I send a mail with a compressed file as an attachment?

0 Answers  


Is bash an operating system?

0 Answers  


What is @echo off?

0 Answers  


What is the conditional statement in shell scripting?

0 Answers  


Categories