10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I would like to insert n number of characters at the beginning of each line that starts with a given character. If possible, I would be most appreciative for a sed or awk solution.
Given the data below, I would like to be able to insert either 125 spaces or 125 "-" at the beginning of every line... (6 Replies)
Discussion started by: jvoot
6 Replies
2. UNIX for Dummies Questions & Answers
Hi Guys,
I have serveral directories like this:
(2013) blablabla(blabla) - blabla (blabla)
or
(1997) blablabla(blabla) - blabla (blabla)
and have to rename them to something like that:
blablabla(blabla) - blabla (blabla) (2013)
and
blablabla(blabla) - blabla (blabla) (1997)
Easy... (2 Replies)
Discussion started by: Nateshift
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
Need some help with sed.
I have a file that has sections :
e.g.
a=blah
b=blah
d=blah
e=blah
There's many sections in the file. (1 Reply)
Discussion started by: andyatit
1 Replies
4. Shell Programming and Scripting
Hello All,
I have following file contents
cat file
#line=aaaaaa
#line=bbbbbb
#line=cccccc
#line=dddddd
line=eeeeee
#comment=11111
#comment=22222
#comment=33333
#comment=44444
comment=55555
Testing script
Good Luck!
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies
5. Shell Programming and Scripting
Hello.
I am using :
sed -i -e '/§name_script§/a#'"${MY_TAB11}"'# \
#'"${MY_TAB1}"'The Standard way'"${MY_TAB7}"'# \
#'"${MY_TAB1}"'==============='"${MY_TAB7}"'# \ ' "$CUR_FILE"
Is there a better way to define "MY_TAB7","MY_TAB11" in other way than :
MY_TAB1=$'\t'
MY_TAB2=${MY_TAB1}$'\t'... (2 Replies)
Discussion started by: jcdole
2 Replies
6. UNIX for Dummies Questions & Answers
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Discussion started by: cokedude
3 Replies
7. UNIX for Dummies Questions & Answers
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
Discussion started by: jawsnnn
3 Replies
8. UNIX for Dummies Questions & Answers
What is a regex for "the dalai lama, his holiness the"
that would just grab "the dalai lama"
and one that would just grab "his holiness the"? Both should exclude the comma..
I was trying '^.*' and many variants with no luck. (6 Replies)
Discussion started by: glev2005
6 Replies
9. Shell Programming and Scripting
Hi there I have a list of mac addresses that are in this format
0100237D2136XX
0118A905599EXX
0118A9054E15XX
010003BAF1F3XX
0118A905599EXX
0100237D6522XX
010C53BAF1F3XX
010003BAF1F3XX
010C53BAF1F3XX
The 01 is at the beginning has been put on by my software, but the rest is the mac... (0 Replies)
Discussion started by: rethink
0 Replies
10. Shell Programming and Scripting
Could anybody help me.
I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line.
Thanks. (5 Replies)
Discussion started by: mascorro
5 Replies