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 / deep
instead of
. script2.sh
Just try
sh script2.sh
It will Run
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why do we use shell scripting?
How does ls command work?
Explain about "s" permission bit in a file?
What is shell geeksforgeeks?
I have 2 files and I want to print the records which are common to both.
How are shells born?
How will you copy a file from one machine to other?
What happens when you type ls?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
What are filters explain sort with all the options available?
What does egrep mean?
What does $0 mean in shell script?
How do I open the shell in cmd?
I want to connect to a remote server and execute some commands, how can I achieve this?
What are the disadvantages of shell scripting?