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 is the difference between running a script as
./scriptname.sh and sh scriptname.sh



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

Answer / vidhu

while running the script using this "./" script run from
curent location we have to give executable permision to the
script file
By default file contains 644 permissions there is no
execute permission while running it shows error
use `chmod` to give execute permission and run
where as "sh" it runs the script with the help of default
shell

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More Shell Script Interview Questions

what is the difference between cmp and diff commands

2 Answers   Amazon, CTS,


How do we delete all blank lines in a file?

0 Answers  


What exactly is a shell?

0 Answers  


How to get the last line from a file using just the terminal?

0 Answers  


What language is bash written in?

0 Answers  


I want to connect to a remote server and execute some commands, how can I achieve this?

0 Answers  


How to check if the previous command was run successfully?

0 Answers  


How to customise the existing shell?

1 Answers  


Can you write a script to portray how set –x works?

0 Answers  


how did u debugging in unix/ linux platform ??( project Related)

2 Answers   Symphony,


What is a shell script in windows?

0 Answers  


what is "umask"?

6 Answers   Wipro,


Categories