I told you to use nawk if you are using sunos/solaris in post #12 , you must have forgotten :), anyways glad to know that you finally got what you expected.
bash-3.00$ nawk --re-interval 'match($0,/([[:digit:]]{2}\/){2}[[:digit:]]{4}/,m){print $1, m[0]}' dump1.log
nawk: unknown option --re-interval ignored
nawk: syntax error at source line 1
context is
>>> match($0,/([[:digit:]]{2}\/){2}[[:digit:]]{4}/, <<<
nawk: bailing out at source line 1
Even for the last command i got error for awk, wut when i ran it as nawk it worked. for every command you gave i tried it using both awk & nawk.
How ever, it worked for me.. thank a lot for your time.... !!!
---------- Post updated at 07:03 AM ---------- Previous update was at 07:00 AM ----------
hope i am not harassing you with my silly doubts...
I have another basic doubt.
I want to run a script file as root, but inside that i need a command that needs to run as different user, is that possible.
ok, say script.sh has the below lines, and i need to run the script as root or user. please tell me if this will work
#!/bin/bash
sudo -t wam /usr/local/wam/stopwam -r ------- this needs run as wam user
/usr/local/web/stopweb -a --- this needs to run as root
/sbin/init 6 --- need to run as root.
this is my requirement, and i need to schedule this job, and i need to give user (either root or wam) while scheduling it.