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 |
What does $# stand for?
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
What is the lifespan of a variable inside a shell script?
what does "kill -9" and "kill -1" do
What is a file basename?
When you login to a c shell, which script would be run first?
What is awk in shell script?
What is batch file programming?
What shell is bin sh?
What is .sh file in mac?
give me some website where i can get unix and testing meterials
How does ls command work?