10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My file has the entries like below...
/dev/sds
/dev/sdak
/dev/sdbc
/dev/sdbu
I want to make the file like below
echo 1 > /sys/block/sds/device/rescan
echo 1 > /sys/block/sdak/device/rescan
echo 1 > /sys/block/sdbc/device/rescan
echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies
2. Shell Programming and Scripting
Hi gurus,
I need add one new line in the begining of current file.
current file
abc
cde
add
xyz
output file
newline
abc
cde
add
xyz (6 Replies)
Discussion started by: ken6503
6 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. UNIX for Dummies Questions & Answers
how to add value/word at the beginning of each line in a file ?
i have file number.txt and the output is below
1000
1001
1002
1003
1004
i want to add 000 at the beginning of each line, desire output is below
0001000
0001001
0001002
0001003
0001004
and so on
please advise how... (5 Replies)
Discussion started by: jason6247
5 Replies
5. 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
6. Shell Programming and Scripting
Well here goes:
I tried to write a batch file that adds a specific fixed text to each line of an already existing text file.
for the adding text infront of each line I tried this:
for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt
for adding text after each line I... (0 Replies)
Discussion started by: pasc
0 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. Linux
How would I do that?
/Rutger (6 Replies)
Discussion started by: rutgerblom
6 Replies
9. Shell Programming and Scripting
Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
Discussion started by: Linux-fueled
3 Replies
10. UNIX for Dummies Questions & Answers
Is there an option, for cat, head, tail, or is there any way, to display a file from last line to first? For example, my file
looks like this:
aaaa
bbbb
cccc
eeee
and I would like to print or display it like this:
eeee
cccc
bbbb
aaaa
thanks (5 Replies)
Discussion started by: jpprial
5 Replies