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

What does $# stand for?

3 Answers   IBM,


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..

0 Answers   Tech Mahindra,


What is the lifespan of a variable inside a shell script?

0 Answers  


what does "kill -9" and "kill -1" do

2 Answers   Amazon,


What is a file basename?

0 Answers  






When you login to a c shell, which script would be run first?

2 Answers  


What is awk in shell script?

0 Answers  


What is batch file programming?

0 Answers  


What shell is bin sh?

0 Answers  


What is .sh file in mac?

0 Answers  


give me some website where i can get unix and testing meterials

1 Answers  


How does ls command work?

0 Answers  


Categories