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 are bootlevel in linux?which level is booting by default.

5 Answers   Symphony,


What is web script?

0 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


What is egrep?

2 Answers  


How important is shell scripting?

0 Answers  






What is gui scripting?

0 Answers  


How would you print just the 25th line in a file using smallest shell script?

4 Answers  


What is a batch file used for?

0 Answers  


What is the first line of a shell script called?

0 Answers  


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

0 Answers   Wells Fargo,


How Connect to a Database in Shell Programming?

4 Answers   Syntel,


Which scripting language is best for automation?

0 Answers  


Categories