10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Everyone,
I need some help with sed and I'm totally new to it.
I have a template file with variables in it. These variables start with a '$' sign and are exactly one character long (plus the '$' sign). For example: $a, $b, etc.
Each variable should be replaced with the contents of a... (9 Replies)
Discussion started by: csarli2006
9 Replies
2. Shell Programming and Scripting
if i want to display the contents of a file between say line number 3 and 10 then i use the following command
sed -n '3,10p' filename
if this 3 was contained in x and 10 was contained in y then how wud this command modified?
sed -n '$x,$yp' filename does not work..please advise (2 Replies)
Discussion started by: arindamlive
2 Replies
3. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I have been asked to create a bash script to delete comments from another file but in the file they have an echo command with this inside of it /* this is an echo */\ so obviously they want to keep this one in the file. I have found... (5 Replies)
Discussion started by: syco__
5 Replies
4. AIX
Hi,
I have to insert a line having variables using sed. But the variables are not getting substituted within sed.
Ex:
n=2
sed $n' i\
hi' file
This works. But the below code does not work.
n=2
line=hello
sed $n' i\
$line' file
The above code inserts '$line' in the 2nd line of the... (9 Replies)
Discussion started by: sugan
9 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I am using LATEX and need to delete all the lines in a file matching:
\begin{work}
I know there are several ways to do this, but I am trying to do it with the substitute command in VI. The problem is I can't get substitute to recognize the character '\'!
How do I do it?
... (7 Replies)
Discussion started by: ScKaSx
7 Replies
6. Shell Programming and Scripting
hi
i have one file where i want to substitute only first instance of
swap
with swap1
i want to replcae only first instance of swap in my script
i know we can do this with awk. but i need to do this with sed only
i tried follwoing code
sed 's/swap/swap1' filename
but here all... (15 Replies)
Discussion started by: d_swapneel14
15 Replies
7. Shell Programming and Scripting
I wish to give line number from one point to another in sed command like this
sed -n 1,1000000p file1.txt >file2.txt
but variable line number $x,$x+100000 can i give it cos i tried and it was giving an error any suggestions?/
Thx in advance
AC (2 Replies)
Discussion started by: bezudar
2 Replies
8. Shell Programming and Scripting
$db2 connection ...........Q
a=`$db2 -x "select A from tablename where z in (select z from tablename Q where condition fetch first 1 rows only ) with ur"`
b=`$db2 -x "select B from tablename where z in (select z from tablename Q where condition fetch first 1 rows only) with ur"`
$db2... (2 Replies)
Discussion started by: rollthecoin
2 Replies
9. Shell Programming and Scripting
I have a file with a single line in it as below.
field1 field2 field3
Different fields separated by spaces. I need the output as below.
field1
field2
field3
Any sed/awk solution you can suggest? (6 Replies)
Discussion started by: krishmaths
6 Replies
10. UNIX for Advanced & Expert Users
Hello Unix Gurus,
We are doing large system upgrade. We expect upgrade to last 180-200 hours. The servers are located remotely.
I am looking for solution which allows me to reconnect to the same session active on unix server where I launched the process. This would protect from local client... (0 Replies)
Discussion started by: mehtasa
0 Replies