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


Please Help Members By Posting Answers For Below Questions

Why do we use shell scripting?

763


How does ls command work?

810


Explain about "s" permission bit in a file?

834


What is shell geeksforgeeks?

808


I have 2 files and I want to print the records which are common to both.

942


How are shells born?

755


How will you copy a file from one machine to other?

794


What happens when you type ls?

770


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

850


What are filters explain sort with all the options available?

1166


What does egrep mean?

766


What does $0 mean in shell script?

782


How do I open the shell in cmd?

812


I want to connect to a remote server and execute some commands, how can I achieve this?

825


What are the disadvantages of shell scripting?

892