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
What is .sh file in mac?
Explain about the exit command?
What is ms powershell?
How do you know which shell I am using?
What does $$ mean in shell script?
How do scripts work?
Explain about sourcing commands?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
What language is bash written in?
Is shell and terminal the same?
How will you pass and access arguments to a script in linux?
What is a shell script? Can you name some of its advantages?
Suppose you execute a command using exec, what will be the status of your current process in the shell?
Write the syntax for "if" conditionals in linux?
What happens when you type ls?