Hi,
I have a script called sam.sh which consists of a single echo statement like this
#/usr/bin/ksh
echo "Mani"
I changed the mode for the script by giving chmod a+x sam.sh.
If I want to execute the scrpt by just giving the name at the command line "sam.sh", what should I necessarily do? I dont want to execute the script as ./sam.sh
The solutions above will only work if the directory containing the script is in your path - the reason you have to type ./sam.sh is to specify the that the script is in your current working directory (.).
You could change your path to include the directory containing the script (your home directory?) or the current directory (.) or, better, create an alias, e.g.
Note that this needs to be an absolute path starting with a slash (like /home/mine) not relative to the current working directory (like ./mine) so that it will work whichever directory is current.
Put this in your login file (.profile, .bash_profile, .cshrc or whatever it is for your system) to make it available each time you log in.
Hi All,
I am a newbie to shell scripting. I am trying to something like this.
#!bin/bash
cd /u01/app/oracle/
# then start the process
./opmnctl startall
Can someone help me with this requirement.
Help is very much appreciated.
Thanks
Venkat
Please use code tags next time for... (10 Replies)
Hello Gurus,
Can anybody please help me to understand as what does this lines(Marked in bold) does:
_TABLESPACE_OFFLINE=`cat ${_tmp_res} | grep -iv "online" | grep -v "^*$" | grep -iv "SQL>"` ------->1
if ;then
_tmp_tablespace_status=1
... (1 Reply)
Dear Friends,
If i give the command echo $- i am getting output of himBH. Can some body explain what does it means
echo $-
himBH
Thanks in Advance
Rajkumar (2 Replies)
Hello All,
I am setting up a cron job, where i am calling a shell script to make few builds. I got struck at a point, need some expert inputs to proceed further.
The script is categorized in 5 parts and in the last part while building software it asks for few questions like:-
1. Build mode... (4 Replies)
Hi,
I am very new to this forum, can any one tell me which is the very basic certification on unix shell scripting?
please give me an advice on this. (1 Reply)
hi,
I am new script learner,
so my basic doubt is ,
how to store value of any command in a variable example
$ ls | wc -l
i want to stote the output of this in a variable c.
so that i can use c in if else loop.
and when do we use " ` " symbol in script..
can anyone also tell for... (5 Replies)
If I did indeed grep something out of it, why woudln't $result show nothing?
When I do $? , it does show success...
What is the proper syntax so that $result shows actual thing it's grepping out?
result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null`
#echo... (3 Replies)
On the below "IF" i test if the user have put the first argument.
I also would like to test if the user have written a second argument.
So, my doubt is:
- How can i evaluate 2 conditions on a if statement? How is the OR created?
- How can i to verify if the second argument is non... (1 Reply)