Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 lives in a shell?

909


What shell is bin sh?

918


What is meant by $1 in shell script?

916


What is the difference between grep and egrep?

1078


What are the two files of crontab command?

1154


What exactly is a shell?

1021


What is in a script?

963


How can you get the value of pi till a 100 decimal places?

921


What are the different types of variables used in shell script?

994


How to print all array elements and their respective indexes?

912


What are zombie processes?

979


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

6341


What is path variable bash?

1000


Where is bash history?

867


How will you connect to a database server from linux?

994