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.
Answers were Sorted based on User's Feedback
Answer / deep
instead of
. script2.sh
Just try
sh script2.sh
It will Run
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
write a scwipt that a) takes exactly one argument, a directory name. b) if the number of argument is more or less than one,print a usage message c) if the argument is not adirectory, print another message d) for the given directory, print the five biggest files and the five files that were most recently modified. e) save the output to a file called q2output.
What is awk in shell script?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
What is the use of "test" command?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"
What is sh in shell script?
What is scripting autism?
Explain about debugging?
Why is it called a shell?
What is the conditional statement in shell scripting?
How Connect to a Database in Shell Programming?