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 / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the various stages of a linux process it passes through?

875


What does the sh command do?

845


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

780


What is shell and shell script?

810


What are the disadvantages of shell scripting?

882


How would you compare the strings in a shell script?

775


How to print pid of the current shell?

797


What is in a script?

762


What is gui scripting?

831


How to set an array in linux?

826


What does echo $0 do?

770


Write a shell script to get current date, time, user name and current working directory.

869


What is a shell in operating system?

802


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

779


What is shell company all about?

775