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
What does the sh command do?
Is cmd a shell?
Explain about non-login shell files?
What is the first line of a shell script called?
Can we run shell script in windows?
What is scripting used for?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
How can I set the default rwx permission to all users on every file which is created in the current shell?
What exactly is a shell?
What is shell geeksforgeeks?
What is path variable bash?
Explain about echo command?
Is powershell a bash?
What are scripts in psychology?
What is computer cli?