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 is an inode block?
How to add some content in any file at some desired location without using VI or some other editor in UNIX
How does ls command work?
Is bash a shell script?
how will you find the total disk space used by a specific user?
What are the various stages of a linux process it passes through?
What is bourne shell scripting?
What's the difference between scripting and coding?
What does chmod do?
how to separate the even and odd number generated from one file to two separate file i.e. even numbers in file1.txt and odd numbers in file2.txt
Hi, I want to practise Unix korn shell scripting which i learnt 2 yr bfr. plz suggest software i can use to practise.
What is a boot block?