Im trying to ssh to a remote machine to grep 'x info' *.log and Im able to get the grep output as expected but "after" the policies (1st 14 lines) - I need to skip the first 14 lines.
Its SunOS.
Plz help???
Hi, anthonyraj75:
I'm not quite sure what you need, so here's a shot in the dark:
sed -n '1,14d;/x info/p' *.log
Regards,
Alister
Im actually trying the following way (but don't expect first 14 lines) - ssh and grep (skipping 14 lines):
ssh user@<host> grep '*.dbf' /opt/sdg/apps/dsmerror.log
awk '/x info/, NR>14' *.log
awk '/x info/, NR>14' *.log
Doesn't seem to work either - I fixed it, by
ssh user@<host> grep '*.dbf' /opt/sdg/apps/dsmerror.log 2 > /dev/null
But encountering similar issue on Linux OS, unable to skip the Security Header (1-14 lines):
Tried various options:
2 > /dev/null
awk '/x info/, NR>14'
2 >/dev/null >/dev/null"
awk 'NR>14'"
>>/dev/null 2>&1
2 >>/dev/null 2>&1
</dev/null 2> /dev/null
> /dev/null 2>&1 </dev/null
sed '1,14d'
head -14
&2 >1
&1>2
1>/dev/null 2>/dev/null
1>/dev/null
- But still doesn't help. Please suggest if there is any alternatives?
Thanks.
Sorry, my command seems to not work. Can you try this?
awk 'NR > 14 && /x info/' *.log
I'm sorry, I didn't get you...could you please let me know how do you want me to run?
(Remember I'm making a ssh call)
Is this what you mean:
ssh user@<host> awk 'NR > 14 && /x info/' grep '.dbf' /opt/sdg/apps/dsmerror.log or
ssh user@<host> grep '.dbf' /opt/sdg/apps/dsmerror.log awk 'NR > 14 && /x info/'
Please let me know how?
Can you use this?
awk 'NR > 14 && /dbf$/' /opt/sdg/apps/dsmerror.log