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
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
What is shell company all about?
How can we find the process name from its process id?
How do I edit a .sh file?
Given a file find the count of lines containing the word "abc".
What is sudo command?
What is the difference between grep and egrep?
What is mac default shell?
How are shells born?
What is console line?
What is a shell script? Can you name some of its advantages?
How do I debug a shell script?
What is the equivalent of a file shortcut that we have a window on a linux system?
How do I open the shell prompt?
When should shell programming/scripting not be used?