you can check for both the commands using man page
man awk
man basename
you can use in below manner . this code will give you only test in the output
you can use awk for almost ever thing using different combinations
can use for substr , printing any argument for n number of things
will show you few examples below
will print the third argument in the ll-rt o/p . By default delimeter used is space
will print the last argument of ll -rt o/p which will be the file or directory name
will print "est" in the o/p similar to our pl/sql fn substr
will print "test" in the o/p . Filtering is done on basis of "/" and print
1st argument i.e on left "/"
Similarly you can do many many more things with "awk" command
Hello everyone,
I'm looking for the meaning of this expression, as I don't understand it quite clearly : $1^
What do you think it could be?
I thought either:
- match lines starting with argument 1 but it should be ^$1
- turn line around : word becomes drow
Thanks in advance for your... (4 Replies)
Please let me know the meaning for the below statements in shell scripting.
1) exit -99
--------------------------------
2) set prgdir = `pwd`
set runFlag = runFlag:FALSE
-------------------------------------
3) if (-f $prgdir/maillst.eml) then
set distEmail = `cat $prgdir/maillst.eml`... (1 Reply)
Hi ,
Can anyone please let me know whta the follwoing piece of code for
ScriptName=${0##*/}
if pgrep -f "$ScriptName" | grep -v "^$$\$" ; then
echo `date`": Sctipt $ScritName is already runnig"
exit
fi
Thnx a lot in advance
Please use code tags when posting data and code... (8 Replies)
can some one please tell the meaning of the second statement i.e
n=${m#*=}
i couldnt get the meaning of the #*=
1.) m="mohit=/c/main/issue"
echo $m
result
-----------
mohit=/c/main/issue
2.) n=${m#*=}
echo $n
RESULT
-------
/c/main/issue (1 Reply)
#!/bin/sh
$ORACLE_HOME/bin/sqlplus -S $orauserid/$orapasswd@$oradb << _TMP
alter session set nls_date_format = 'YYYYMMDD HH24:MI';
set linesize 100
set pagesize 400
ok the above is part of a script..i just wanna know what does sqlplus -S means?? as in why we need to insert the -S behind? (2 Replies)