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.

Answers were Sorted based on User's Feedback



Hi, all Scripting professional. Q. I have written script1.sh and calling script2.sh in script1.sh..

Answer / deep

instead of

. script2.sh

Just try

sh script2.sh

It will Run

Is This Answer Correct ?    1 Yes 0 No

Hi, all Scripting professional. Q. I have written script1.sh and calling script2.sh in script1.sh..

Answer / jitesh varshney

write code like this :

#!/bin/bash
echo "My script2 call"
/bin/bash ./script2.sh [ or /bin/ksh ./script2.sh ]

It will run ..... enjoy !!!!!!

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Shell Script Interview Questions

How do I run a shell script on a mac?

0 Answers  


What is the syntax of "grep" command?

4 Answers  


How do you read arguments in a shell program - $1, $2 ..?

4 Answers  


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.

0 Answers  


What is gui scripting?

0 Answers  






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

0 Answers  


What makes c shell a more preferable option than the bourne shell?

0 Answers  


What are the additional egrep symbols?

2 Answers  


What is meant by $1 in shell script?

0 Answers  


In a single command how do you run the previous command in the command prompt.

5 Answers  


Is shell a scripting language?

0 Answers  


What is the best shell scripting language?

0 Answers  


Categories