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
How does ls command work?
what is tickets $ what low,medium,high priorite pls define time also
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.
Why is it called a shell?
How to set an array in linux?
What is shell terminal?
How will you print the login names of all users on a system?
What is shell prompt?
Which shell is the best?
Tell something about the super block in shell scripting?
What are the advantages of shell script?
Can we run shell script in windows?
What is the use of "$#" in shell scripting?
What is a batch file used for?
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.