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.
Answer Posted / deep
instead of
. script2.sh
Just try
sh script2.sh
It will Run
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What language is bash?
How to print the first array element?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
What is shell variable?
What does .sh file contain?
Is shell script a programming language?
c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again
What are the default permissions of a file when it is created?
How to get the last line from a file using just the terminal?
What is a shell made of?
How would you compare the strings in a shell script?
How do I run a bin bash script?
What is $1 in shell scripting?
Explain about non-login shell files?
What is shell scripting?