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

Which is better perl or shell scripting?

0 Answers  


What is the default ubuntu terminal?

0 Answers  


What is the use of .sh file?

0 Answers  


What's the difference between scripting and coding?

0 Answers  


What does sh mean?

0 Answers  






Which is best institute for testing tool?

0 Answers  


determine the output of the following command: echo ${new:-variable}

0 Answers  


What are environment variables?

2 Answers  


What is the fastest scripting language?

0 Answers  


what is the difference between cmp and diff commands

2 Answers   Amazon, CTS,


There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a file with multiple records have same combination of fields but with unique roll numbers.The script should work for different names in the input file.

1 Answers   Wipro,


What are the advantages of shell scripting?

0 Answers  


Categories