10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
2. Shell Programming and Scripting
im currently running the following command to grab all arguments in front of a script, directly from the process table.
# cat /tmp/allmyprocs
ubuntu 9933 27793 0 03:29 pts/0 00:00:00 /bin/sh ./prying.sh
ubuntu 9941 9933 0 03:29 pts/0 00:00:00 sh
ubuntu 9952 9941 0 03:29... (1 Reply)
Discussion started by: SkySmart
1 Replies
3. UNIX for Dummies Questions & Answers
Would like to convert it to one line
sed -i -e '/./,$!d' term1.txt
sed -i '2d' term1.txt
sed -i '/^$/Q' term1.txt
cat term1.txt>> test1.txt
Appreciate if someone could point out the error
sed -i -e '/./,$!d' -e '2d' -e '/^$/Q' term1.txt
cat term1.txt>> $test1.txt
... (6 Replies)
Discussion started by: w020637
6 Replies
4. Shell Programming and Scripting
hi all
I have two files
file1
aaa
bbb
ccc
ddd
file2
111
222
333
444
I would like to using "SED" combine two files together
Please help
Thank all (3 Replies)
Discussion started by: yuesko
3 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
What is the sed command use to combine line?
Example:
Below is an output after extracted from few commands
aaa
bbb
ccc
ddd
eee
fff
ggg
and i would like to combine all the line as shown below,
aaa,bbb,ccc,ddd,eee,fff (5 Replies)
Discussion started by: 793589
5 Replies
6. Shell Programming and Scripting
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
Discussion started by: cbo0485
1 Replies
7. Shell Programming and Scripting
I am a beginner at shell scripting, actually i am working on my first script right now.
Anyway i have searched the world how to grep two letters from each word (it will always just be two words).
For example:
Example Blablabla
I want my script to cut out Ex (from the first word) and Bl... (4 Replies)
Discussion started by: maskot
4 Replies
8. UNIX for Dummies Questions & Answers
hi..im new to UNIX...
ok i have this information in the normal shell...
there are 2 lines display like this:
h@hotmail.com
k@hotmail.com
i want it to display like this with a space betweem them
h@hotmail.com k@hotmail.com
the information is stored in a text file....
anyone... (10 Replies)
Discussion started by: forevercalz
10 Replies
9. UNIX for Dummies Questions & Answers
how do i search for the phrase "expected" on line one and
"received" on line two. (there is a newline in between the two)
I would like to know if/how this can be done in perl and/or
grep and/or sed (3 Replies)
Discussion started by: artjaniger
3 Replies
10. UNIX for Dummies Questions & Answers
does anyone know how to combine 2 lines? this is what im playing around with.
(filename: online, user name: prml0001, real name: primal)
#!/bin/sh
who | grep $1 > /dev/null
if
then
grep $1 /etc/passwd | cut -f 5, -d :
echo is logged on
exit 0
else
grep $1... (13 Replies)
Discussion started by: primal
13 Replies