10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am modifying a file with sed command. i want to make SCORE= blank in the file whereever SCORE=somevalue.
What will *$ do in the below command?
cat $file | sed 's/SCORE=.*$/SCORE=\r/g' > newfile
The last line is also missing in the new file. How to make SCORE='100' to SCORE=... (5 Replies)
Discussion started by: ashok.k
5 Replies
2. Shell Programming and Scripting
I am trying to print those line which has no # in the begining of the line.
The sed I used for this purpose as shown below is not giving the required output.
echo 'PDE 5600' | sed -n 's/^\!#/&/p'
Where lies the problem:confused: (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies
3. Shell Programming and Scripting
3
10 20
10 100
100 10000
Output:
3
10 20
10 100
100 10000
---------- Post updated at 07:59 AM ---------- Previous update was at 07:56 AM ----------
sed '/^$/d' file doesn't work. (8 Replies)
Discussion started by: cola
8 Replies
4. Solaris
Hi guys.
I need a sed command to print like 10 lines after a regular expression is found in the log.
Can anyone help me out.
Thanks
---------- Post updated at 10:52 AM ---------- Previous update was at 10:34 AM ----------
never mind.
I just did the search bewteen two expressions. (1 Reply)
Discussion started by: jamie_collins
1 Replies
5. UNIX for Dummies Questions & Answers
:confused:Hi,
I'm relativley new at unix so am having difficulties at the most basic of areas. I am trying using sed to make multiple lines into one line.
For example, i would like:
Mary
had
a
little
lamb
to look like this
Maryhadalittlelamb
so far i have tried
sed... (1 Reply)
Discussion started by: cavanac2
1 Replies
6. Shell Programming and Scripting
Hi,
I want to add a character "#" in this few lines with sed command
Initial:
### CACCIA: DEBUT ###
if $(grep -wqi "$2" /etc/passwd); then
chuser -R files registry=files $2
fi
### CACCIA: FIN ###
Result with sed command:
### CACCIA: DEBUT ###
#if $(grep -wqi "$2"... (4 Replies)
Discussion started by: khalidou13
4 Replies
7. UNIX for Dummies Questions & Answers
hi i have a long sed command in a csh script that won't fit on 1 line.
how do i break it up correctly over multiple lines?
this doesn't seem to work in csh:
sed -e s/template/$IP.$NN/ \
-e s/NRG/6/ \
-e s/inputf/$IS.$NN/ \
-e s/SHIFT/10.0/ <template.egsinp > $IP.$NN.inp
i get:
sed:... (1 Reply)
Discussion started by: tuathan
1 Replies
8. Shell Programming and Scripting
Sorry for the duplicate thread this one is similar to the one in
https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies
9. Shell Programming and Scripting
hi,
I am using the following code to get the first field of all the lines in a file using sed command.But its not printing the last line.Why it is so and how can i read the different fields of each line ?
code:
for i in $(sed = filename.txt | sed 'N;s/\n/ /' | cut -d " " -f1)
do
val1=`sed... (5 Replies)
Discussion started by: Sharmila_P
5 Replies
10. Shell Programming and Scripting
the file contains the follwoing lines
/*
* Copyright (C) 1995-1996 by XXX Corporation. This program
* contains proprietary and confidential information. All rights reserved
* except as may be permitted by prior written consent.
*
* $Id: xxx_err.h,v 1.10 2001/07/26 18:48:34 zzzz $
... (1 Reply)
Discussion started by: radha.kalivar
1 Replies