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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1167


What are script files?

1040


How to print the first array element?

1042


What is difference between bash and shell?

1112


How does ls command work?

1038


What is the use of echo in shell script?

1012


Suppose you execute a command using exec, what will be the status of your current process in the shell?

1080


What is the use of a shebang line?

1200


Is shell a scripting language?

1019


What are "c" and "b" permission fields of a file?

1028


What's the difference between scripting and coding?

1189


What is shell and terminal?

1008


What is the way to do multilevel if-else's in shell scripting?

1303


Why should we use shell scripts?

1061


How to print pid of the current shell?

1000