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 / 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 |
Post New Answer View All Answers
Can shell script run on windows?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
How to get the first line from a file using just the terminal?
write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.
What is console line?
Explain about debugging?
Write a command sequence to find the count of each word?
What is a shell made of?
is this growing field and what is average package in this?
What is shell terminal?
Is it possible to substitute "ls" command in the place of "echo" command?
Is shell scripting difficult?
How important is shell scripting?
Which shell is the best?
What is the command to find out users on the system?