08-23-2010
Oh. I should have mentioned it more explicitly.
If you look carefully, the sed quotes that I use are double quotes and not single.
If you want to use variables with sed, you should be using double quotes.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how to use sed command to find and replace a directory
i have a file.. which contains lot of paths ...
for eg.. file contains..
/usr/kk/rr/12345/1
/usr/kk/rr/12345/2
/usr/kk/rr/12345/3
/usr/kk/rr/12345/4
/usr/kk/rr/12345/5
/usr/kk/rr/12345/6
/usr/kk/rr/12345/7... (1 Reply)
Discussion started by: wip_vasikaran
1 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have a file and in that, I want to search for a aprticular word and then replace another word in the same line with something else.
Example: In file abc.txt, there is a line
<host oa_var="s_hostname">test</host>
I want to search with s_hostname text and then replace test with... (2 Replies)
Discussion started by: sshah1001
2 Replies
3. Shell Programming and Scripting
Hello,
I have this command and it works fine.
My question is that how can we replace the N by a variable, to print for instance a big number of lines. It means if I want 100 lines after an expression, to not put "N" 100 times in the sed.
Code:
$ sed -n '/aaa/{n;N;N;s///g;s/;/; /g;p;}'... (2 Replies)
Discussion started by: rany1
2 Replies
4. Red Hat
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Discussion started by: cielle
6 Replies
5. Shell Programming and Scripting
I need to use a shell script, using sed command how to replace date variable value in following format.
04/18/2012 11:38:55
Because the sed is treating the '/' as a parameter instead of the value of a variable, and hence there is the message as
sed: command garbled: s/insert/04/18/2012... (9 Replies)
Discussion started by: jannusuresh
9 Replies
6. Shell Programming and Scripting
Hi,
I am trying to replace the value of a variable in a file through another script.
Example:
Filename : abc.txt contents:
a=10
b=20
c=30
Need to change the value of, say, b - Tried using the following:
sed "s/${b}/15/g" abc.txt
Have tried various forms of sed (with single quotes,... (4 Replies)
Discussion started by: rituparna_gupta
4 Replies
7. Shell Programming and Scripting
I have a file having some text like:
PATH_ABC=/user/myLocation
I have to replace "/user/myLocation" with a session variable say, $REPLACE_PATH,
where $REPLACE_PATH=/user/myReplaceLocation
The following sed command is not working. It is writing PATH_ABC=$REPLACE_PATH in the file
... (2 Replies)
Discussion started by: SKhan
2 Replies
8. Shell Programming and Scripting
I have a file example.txt as follows :SomeTextGoesHere
$$TODAY_DT=20140818
$$TODAY_DT=20140818
$$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script.
(It would even be better if I could pass... (5 Replies)
Discussion started by: SriRamKrish
5 Replies
9. Shell Programming and Scripting
how to search and replace string in column in file with command sed or other
search "INC0000003.in" and replace column 4 = "W"
$ cat file.txt
INC0000001.in|20150120|Y|N|N
INC0000002.in|20150120|Y|N|N
INC0000003.in|20150120|Y|N|N
INC0000004.in|20150120|Y|N|Noutput... (4 Replies)
Discussion started by: ppmanja3
4 Replies
10. UNIX for Beginners Questions & Answers
Hi All
I have one file with multiple lines in it, each line has static text and some variable enclosed in <<filename>> as well. e.g. as below
123, <<file1.txt>> this is my name, I stay at <<city.txt>> Thanks for visiting
348384y, this is my name <<fileabc.txt>>, I stay at near the mall of... (8 Replies)
Discussion started by: reldb
8 Replies
LEARN ABOUT DEBIAN
impressive-gettransitions
IMPRESSIVE-GETTRANSITIONS(1) Debian GNU/Linux manual IMPRESSIVE-GETTRANSITIONS(1)
NAME
impressive-gettransitions - Generate Impressive info scripts for LaTeX presentations
SYNOPSIS
impressive-gettransitions FILE.tex
DESCRIPTION
A simple script to produce a .info file for use with Impressive, using special comments in a LaTeX/Beamer file. FILE.tex is a file to be
parsed into .info file. For each /fullpath/blah.tex /fullpath/blah.pdf.info gets produced.
SYNTAX
In the LaTeX document, impressive-gettransitions counts the pages to determine the PDF slide number of each one.
The simpler page changes are automatically detected, that is:
egin{frame} and:
pause
Other, more elaborated page changes must be noted with a %O comment:
item<1-> Foo
item<2-> Bar %O
The transition to apply can be specified in a %O comment:
egin{frame} %O SlideUp
OPERATION
When the .info file corresponding to the LaTeX document already exist, impressive-gettransitions does not clear it, but only adds the
transitions if finds to it.
Thus, if you modified your document in a way that requires to completely replace the transitions, manually clear the PageProps section of
the .info file. This can be done by running the following sed command:
sed -i -e "/^PageProps = {/,/^}/d" FILE.info
SEE ALSO
impressive(1)
AUTHOR
impressive-gettransitions (originally gettransitions) has been written by Rob Reid.
This manpage has been originally written by Yaroslav Halchenko <debian@onerussian.com>.
Debian Project 2012-02-10 IMPRESSIVE-GETTRANSITIONS(1)