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
Answer / deep
instead of
. script2.sh
Just try
sh script2.sh
It will Run
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
In a single command how do you run the previous command in the command prompt.
Write a shell script to get current date, time, user name and current working directory.
Which scripting language is best for automation?
What is the use of a shebang line?
How do you know which shell I am using?
What is the basic difference you find between a shell script and perl?
What's the difference between scripting and coding?
How to print pid of the current shell?
what does "kill -9" and "kill -1" do
How to declare functions in unix shell script?
How to get the 3rd element/column from each line from a file?
Hi All, Is it possible to create one file name only space or space in file name in UNIX and we can able to run that on Unix?