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,
I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|".
I am looking for some command/option to join these two in single command parameter.
... (6 Replies)
Discussion started by: bhupinder08
6 Replies
3. Shell Programming and Scripting
Hi Ladies and Gents,
Explanation of my question with an example:
Let's consider the script: backup_every_hour.sh
#!/bin/bash
rsync -auv $dir $backup_dir >> backup_every_hour_script.log
Each time this script is called there will be a new entry at the end of the file... (1 Reply)
Discussion started by: freddie50
1 Replies
4. Shell Programming and Scripting
sed '$a\
hello' books
hi i am trying to use sed to append hello to the end of the file books, but for some reason i can't get it work. It keeps sayin command garbled. Anyone know what I'm doing wrong. this is in a ksh script as well. (3 Replies)
Discussion started by: bjhum33
3 Replies
5. UNIX for Dummies Questions & Answers
about 200 files with names as
11_0.pdb
11_60.pdb
12_12.pdb
14_180.pdb
are there in my library...I need to rename all of them by addinf File in front of them as:
File11_0.pdb
File11_60.pdb
File12_12.pdb
File14_180.pdb
I checked many threads but it seems i get even more confused..i... (1 Reply)
Discussion started by: kanikasharma
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have file a.txt as below. I want to add one string root beginning of each line.
Sample file a.txt
aaa
bbb
ccc
Sample output
Root aaa
Root bbb
Root ccc
Can any one help me on this? (6 Replies)
Discussion started by: siba.s.nayak
6 Replies
7. 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
8. Shell Programming and Scripting
Hi
I have few files. For some files the cursor is at the end of last line. For other files, cursor is at the new line at the end.
I want to bring the cursor down to next line for the files that are having cursor at the end of last line
In otherwords, I want to introduce a blank line at the... (5 Replies)
Discussion started by: somesh_p
5 Replies
9. Shell Programming and Scripting
How can i add a character(#) in the beginning of every line in a .dat file (2 Replies)
Discussion started by: Cool Coder
2 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