10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have the following code. I wonder if it can be combined into 1 command.
y=`ls -1| tail -n 1`
m=${y%.abc}
Thank you. (3 Replies)
Discussion started by: april
3 Replies
2. Shell Programming and Scripting
Hi,
Can someone please guide me how to combine the following two awk calls in one?
I noticed that it is very often situation for me, and I think that it can be replaced with one awk call.
The question is more general, not the exact one.
echo "A B C/D" | awk '{print $3}' | awk -F/ '{print... (4 Replies)
Discussion started by: mirusnet
4 Replies
3. Shell Programming and Scripting
my code:
gawk 'NR>'"${LASTLINENUM}"' && NR<='"${LINEENDNUM}"'' ${LOGFILE} | gawk '{l=$0;} /'"${STRING1}"'/ && /'"${STRING2}"'/ {for (i=NR-'"${BEFOREGLAF}"'; i<=NR+'"${AFTERGLAF}"'; i++) o=i; t++;} END { for(i=1; i<=NR; i++) if (o) print l; print t+=0;}'
i would like to combine this into one... (5 Replies)
Discussion started by: SkySmart
5 Replies
4. Shell Programming and Scripting
Hey everyone,
I am working in an environment where the different users can use ksh or csh. My situation is that I need the same result with one single command line.
I am searching for the real path the file is in.
My ksh input and output
ts2:ts2adm> cd $(dirname $(which sapcontrol)); pwd -P... (2 Replies)
Discussion started by: h1kelds
2 Replies
5. Shell Programming and Scripting
Hi Team,
I am getting input like below
$ ps -ef | grep pmon | grep -v asm | grep -v grep
oracle 3246 1 0 00:03 ? 00:00:01 ora_pmon_racora1
oracle 4367 1 0 00:03 ? 00:00:01 ora_pmon_test1
oracle 6893 1 0 00:03 ? 00:00:01 ora_pmon_gipora1... (6 Replies)
Discussion started by: kamauv234
6 Replies
6. Shell Programming and Scripting
sed -e :a -e 's/<*>//g;/</N;//ba' a2.html -removes html tags
and
sed -i 's/YOURS TRULY/Joe Bob/' a2.html
Replaces a string with another string
can i make it into one string? (2 Replies)
Discussion started by: boyboy1212
2 Replies
7. Shell Programming and Scripting
I'm working with a file with an xml structure. I'd like to parse it down to just the bits i want. Here is and example of the file
<message id="96352877" method="status">
<date rfc="Sat, 12 Mar 2011 16:13:15 -0600" unix="1299967995" />
<services>
<service id="facebook"... (4 Replies)
Discussion started by: Erulisseuiin
4 Replies
8. Shell Programming and Scripting
How would I combine two nawk commands together without calling up nawk twice. Just like the sed -e command
nawk '$3>=from&&$3<=to' from="$STIME" to="$ETIME" | nawk '{$5="";$6=""}1' (2 Replies)
Discussion started by: numele
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
i tried to combine grep with find and it didnt work
grep 'find dirname filename"
i also would like that the file will be sorted in the way.
thanks a lot. (2 Replies)
Discussion started by: Spoiler
2 Replies
10. Shell Programming and Scripting
How i can combine output of two commands in one file.......i tried this but it is not working although each command is working good seperately.....
head -1 filename | tail -1 filename
i think there is problem with command concatenator? (16 Replies)
Discussion started by: 33junaid
16 Replies