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

What is meant by $1 in shell script?

710


How to set an array in linux?

786


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

3785


c program to display the information of given file similar to givan by the unix or linux command ls -l

1919


What does echo mean in scripting?

776


what is info area how many types?

2489


How to redirect both standard output and standard error to the same location?

890


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2234


What is the first line in a shell script?

766


Is powershell a language?

749


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

1951


How will you print the login names of all users on a system?

727


Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

2030


What are the different communication commands available in the shell?

698


Write down the syntax of "for " loop

801