help with lil' script
I know this is off topic, but I saw that the programming forum is kind of dead...
So my problem is: I want to repalce from a script the leading path /mnt/cdrom or something else given as an argument and to transform it into some other string... the problem is with the /-es in the path... they screw up the sed params.... I tried replacing static text weih the contents of a var and it works ... the probl is with both vars.... Here is the script... and is a GNU version 2.... if anybody wants it. Code:
...... will be in the next post |
sed 's#a/source/path/#other/target/path#' < input.txt > output.txt
Or alternatively: sed 's/a\/source\/path\//other\/target\/path/' < input.txt > output.txt |
Yep thats it ToniT! Pe2338 needs to stop the shell from interpretting the "-" as an option to sed. This is most commonly done by preceding the meta-character with a \backslash-
ART |
Here is the script ....
tried various ways... obvoious from the comments... Code:
|
Quote:
As you can see the heading is in a var $CDDRIVE and the replace is in $CDNAME.... Thanks fo the help ... |
Ok,
I'm sorry, but there are so many tries that I don't follow what are you exactly trying to do and what is the problem with it.
|
All times are GMT -5. The time now is 12:21 PM. |