Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

How does ls command work?

0 Answers  


Hi, all Scripting professional. Q. I have written script1.sh and calling script2.sh in script1.sh file using bash shell as interpreter and my log in shell also bash shell.My code like Script1 #!/bin/bash echo "My script2 call" . script2.sh Here script2.sh file run successfully but when I have changed my interpreter bash to ksh like #!/bin/ksh Error are comming script2.sh command not found. Guid me how to call other script in our main script.

2 Answers  


How to add some content in any file at some desired location without using VI or some other editor in UNIX

2 Answers  


I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

0 Answers  


What is the use of "$?" Sign in shell script?

0 Answers  


What will happen to my current process when I execute a command using exec?

0 Answers  


How to pass an argument to a script?

0 Answers  


What are the 4 basics of OOP?

1 Answers   Amazon, Infosys,


What is the difference between running a script as ./scriptname.sh and sh scriptname.sh

1 Answers  


what are bootlevel in linux?which level is booting by default.

5 Answers   Symphony,


Why do we use shell scripting?

0 Answers  


In a single command how do you run the previous command in the command prompt.

5 Answers  


Categories