09-14-2006
First you are removing v1_host1 from temp2.srv.The result of this stored in newfile.src This result doesn't affect your source file temp2.srv.
Then you are removing v2_host1 from temp2.srv. Finally you have only removed v2_host1.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Is there any way to traverse the file once and look for the following conditions in one sweep instead of going over the file 3 times with different search criteria......
sed -n '/^ORA-07445/ p' /tmp/t$$ > ${OERRFILE}
sed -n '/^ORA-00600/ p' /tmp/t$$ >> ${OERRFILE}
... (1 Reply)
Discussion started by: YS2002
1 Replies
2. Shell Programming and Scripting
Hi,
When deleting lines using sed, as i understand the lines are redirected to the standard output. What i'm unclear about is how to actually modify the file?
If I write the command sed '1,2d' test it will display lines one and 2 onto the screen however the file is not modified? I think my... (5 Replies)
Discussion started by: c19h28O2
5 Replies
3. Shell Programming and Scripting
Hi, :)
can any body explain the following statement
sed 's/\(\)- ]//g'
cheers
RRK (3 Replies)
Discussion started by: ravi raj kumar
3 Replies
4. Shell Programming and Scripting
I have a file that conatins following info
Policy1=U|guestRoom=test1idCode=5(1):!:Amenity2=U|RoomId=testrma=4(1):!:|
GuestRoomAmenity1=U|guestRoomId=testguest1id^rmaCode=5(1):!:|
I need it to look like this
Policy1=U|guestRoom=test1idCode
Amenity2=U|RoomId=testrmaCode... (2 Replies)
Discussion started by: arushunter
2 Replies
5. UNIX for Dummies Questions & Answers
How would I use sed to print everything on the line after the regular expresion?
I have a configuration file setting several variables.
cfg.dat
DDB = cpptest
SUDBNAME = sucpptestdb
host = cpptest
Example
I want to search for the regular expresion 'SUDBNAME =' and print everything on... (3 Replies)
Discussion started by: orahi001
3 Replies
6. Shell Programming and Scripting
Write a sed script to extract the year, rank, and stock for the most recent 10 years available in the file top10_mktval.csv, and output in the following format:
------------------------------
YEAR |RANK| STOCK
------------------------------
2007 | 1 | Exxon... (1 Reply)
Discussion started by: beibeiatNY
1 Replies
7. Shell Programming and Scripting
hi
i have a file with this line:
variable=/export/home/oracle
I want to change the file so that the path is replaced with the value of another variable
var2=/tmp/anything.
how to do this in sed?
thx (4 Replies)
Discussion started by: melanie_pfefer
4 Replies
8. Shell Programming and Scripting
I need to replace the numbers with a new string.
How can I give a wildcard for the different # of numbers
sed '/abcdef/s/abcdef=*/abcdef=999999/'<foo>foo1
From: To:
abcdef=1234 abcdef=999999
abcdef=12345 abcdef=999999
abcdef=123456... (10 Replies)
Discussion started by: beppler
10 Replies
9. UNIX for Dummies Questions & Answers
I am trying to write a script that will take an input text file in the format
person: place: phonenumber;
person: place: phonenumber;
person: place: phonenumber;
...
and output it using sed too:
Name ######## Location ######### Phone Number... (1 Reply)
Discussion started by: jmack56
1 Replies
10. Shell Programming and Scripting
I have the following string:
"File Reader"
I also have a list of directories:
"File Reader (#53)"
"CSV Writer (#47)"
"Scorer (#22)"
I want to search the name of each directory until I find "File Reader". Then, I want the corresponding number to be returned.
For example, if I am... (7 Replies)
Discussion started by: xan.amini
7 Replies
LEARN ABOUT DEBIAN
dr_symlinks
dr_symlinks(1) USER COMMANDS dr_symlinks(1)
NAME
dr_symlinks - maintain a symlink forest
SYNOPSIS
dr_symlinks
DESCRIPTION
For each pair directory/subdirectory under each word in DR_SL_TARGETS, a directory and symlink DR_SL_SOURCE/directory/symlink is created (or
adjusted). The script is implemented as a wrapper around oggsymlinks, by Wessel Dankers.
EXAMPLE
If, in the configuration file $HOME/.draai/symlinksrc, DR_SL_SOURCE is set to /srv/audio and DR_SL_TARGETS is set to "../data/a ../data/b",
while directories
/srv/data/a/And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes/
/srv/data/a/And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self/
/srv/data/a/John_Coltrane/A_Love_Supreme/
/srv/data/b/John_Coltrane/Giant_Steps/
/srv/data/b/Tinariwen/Amassakoul/
exist, the following directories holding the following symlinks will get created in /srv/audio/ :
And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes ->
../../../a/And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes/
And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self ->
../../../a/And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self/
John_Coltrane/A_Love_Supreme -> ../../../a/John_Coltrane/A_Love_Supreme/
John_Coltrane/Giant_Steps -> ../../../b/John_Coltrane/Giant_Steps/
Tinariwen/Amassakoul -> ../../../b/Tinariwen/Amassakoul/
All dangling symlinks and empty directories (if any) under /srv/audio/ will get removed. This script is idempotent.
ANOTHER EXAMPLE
joostvb@hille:~% ls media/usb/audio/200504/Al_Green
The_Very_Best_Of/
joostvb@hille:~% ls media/usb/audio/
200504/ 200708/ 200801/ 200805/ 200807/ 200812/ 200910/ 201005/ 201009/
200609/ 200712/ 200803/ 200806/ 200808/ 200905/ 201004/ 201006/
joostvb@hille:~% cat .draai/symlinksrc.usb
DR_SL_SOURCE=~/media/audio
DR_SL_TARGETS="$( cd $DR_SL_SOURCE && ls -d ../usb/audio/* )"
joostvb@hille:~% DR_SL_RCFILE=.draai/symlinksrc.usb dr_symlinks
joostvb@hille:~% ls -l media/audio/Al_Green
total 0
lrwxrwxrwx 1 joostvb joostvb 48 2011-03-11 09:12 The_Very_Best_Of -> ../../usb/audio/200504/Al_Green/The_Very_Best_Of/
ENVIRONMENT
dr_symlinks honors booleans: DR_SL_VERBOSE, DR_DEBUG and DR_DRYRUN and strings: DR_SL_RCFILE, DR_SL_TARGETS and DR_SL_SOURCE.
FILES, CONFIGURATION
All configuration variables (see ENVIRONMENT) can be set in ~/.draai/symlinksrc. This rc-file is sourced as a shell script. If DR_SL_RCFILE
is set, its value is assumed to be the dr_symlinks rc-file.
COPYRIGHT AND LICENSE
This manpage is copyright 2009, 2011 Joost van Baal <joostvb-draai@mdcc.cx>.
Draai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed WITHOUT ANY WAR-
RANTY. You should have received a copy of the GNU General Public License along with draai. If not, see http://www.gnu.org/licenses/.
AUTHOR
Joost van Baal <joostvb-draai@mdcc.cx>
dr_symlinks 20110603 03 juin 2011 dr_symlinks(1)