10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm working on a script to execute a number of items. One being, editing particular files to add certain lines. I'm attempting to utilize sed, but, having issues when running from a bash script. Assistance is greatly appreciated.
My example:
sed -i '14 i\
# add these lines
add these lines to... (5 Replies)
Discussion started by: Nvizn
5 Replies
2. Shell Programming and Scripting
I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below:
Core Utilization
CoreId %Usr %Sys %Total
------ ----- ----- ------
5 4.91 0.01 4.92
6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies
3. Shell Programming and Scripting
I've tried numerous commands, but I am not sure how to use sed in a loop. This is what I have:
VARZ contains CARD_FILE_LIST and it also contains CARD_FILE_LIST2
so
echo "$VARZ"
CARD_FILE_LIST
CARD_FILE_LIST2
I have a file with 60 lines in /tmp/testfile it and I want those lines deleted... (3 Replies)
Discussion started by: newbie2010
3 Replies
4. Shell Programming and Scripting
Hello all,
I need some help please.
I got file1 with names.
foo bar
foo bar
foo bar
foo bar
foo bar
and I got file2 with some text
some text
some text
#KEYWORD
some text
some text
some text (3 Replies)
Discussion started by: stinkefisch
3 Replies
5. Shell Programming and Scripting
Hi guys, I am currently using this to save first 50 lines into top50.txt and delete them from list.txt ... it's 2 commands:
head -n 50 list.txt > top50.txt && sed -i "1,50 d" list.txt
I want to change that so it's 1 command - whereby sed removes the first 50 lines as above but that which is... (3 Replies)
Discussion started by: holyearth
3 Replies
6. Shell Programming and Scripting
I have two files:
file-gene_families.txt that contains 30,000 rows of 30 columns. Column 1 is the ID column and contains the
Col1 Col2 Col3 ...
One gene-encoded CBPs ABC 111 ...
One gene-encoded CBPs ABC 222 ...
One gene-encoded CBPs ABC 212 ...
Two gene encoded CBPs EFC... (7 Replies)
Discussion started by: yifangt
7 Replies
7. UNIX for Dummies Questions & Answers
Hi Unix gurus,
Maybe it is too much to ask for but please take a moment and help me out. A very humble request to you gurus. I'm new to Unix and I have started learning Unix. I have this project which is way to advanced for me.
File format: CSV file
File has four columns with no header... (8 Replies)
Discussion started by: arvindosu
8 Replies
8. Shell Programming and Scripting
hi,
Im trying to do a sed and save it in teh same file using sed -i option
But i think my system doesnt supports that option at all. BTW, im working in ksh.
Is there any alternate for this?
Thanks (3 Replies)
Discussion started by: dvah
3 Replies
9. Shell Programming and Scripting
I remember there is a sed switch i can use to edit and save the file at the same time, but i cannot recall it at all.
so instead of
-> sed 's/A/B/' file > file-tmp
-> mv file-tmp file
what can i do to just let sed edit and save the "file" (4 Replies)
Discussion started by: fedora
4 Replies
10. Shell Programming and Scripting
hi there !
i have exactly the same problem like this guy here
https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html
i am not able to save the curl verbose output..
the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies