05-19-2005
Try this...
sed -e 's/ID-INTERNAL /1 /g' -e 's/ID-INTERNAL[^-]/1/g' -e 's/ID-INTERNAL$/1/g' $filename
Last edited by RishiPahuja; 05-19-2005 at 09:02 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I'm trying to do the following , I have certain variables in a file and then I want to check for these variables in a certain cobol file to see if they contain a certain package if so replace them with value 1 but but that last line is giving problems:
# for each variable in SQL file
... (1 Reply)
Discussion started by: seaten
1 Replies
2. Shell Programming and Scripting
Hi,
I'm trying to do the following , I have certain variables in a file and then I want to check for these variables in a certain cobol file to see if they contain a certain package if so replace them with value 1 but but that last line is giving problems:
# for each variable in SQL file
... (1 Reply)
Discussion started by: seaten
1 Replies
3. Shell Programming and Scripting
when i do something like substituting a particular thing with a system variable, i am unable to do that expect the varible name getting into that.
for ex.. i tried,
sed -e 's/date/`date`/g' <if >of
but i got date replaced with "`date`" and not with the actual date ..
same case happened... (5 Replies)
Discussion started by: sskb
5 Replies
4. Shell Programming and Scripting
Hi,
I'm trying to use sed to delete the last three lines of a file. I currently have:
# get the amount of lines in the file
foldernum=`wc -l File_In.txt | cut -c1-8`
# remove the lines in the file
sed "${foldernum}-3,${foldernum}d" File_In.txt > File_Out.txt
I get the error - sed:... (5 Replies)
Discussion started by: Mr_Plow
5 Replies
5. Shell Programming and Scripting
HELP!!!
I'm keep getting "sed: Function s/PETS/dog cannot be parsed."
I have 2 files that list...
# cat FILE1.txt
dog
cat
mouse
# cat FILE2.txt
my pets are
PETS
I put this into a variable...
# A=`cat FILE1.txt`
# sed "s/PETS/$A" FILE2.txt > FILE3.txt (5 Replies)
Discussion started by: Zenwork
5 Replies
6. Shell Programming and Scripting
I'm trying to get sed to cut and replace using variables, but it doesnt seem to work, when I run this the mod time of the file does get updated. Is my syntax incorrect in the sed command?
Thanks
#!/usr/bin/ksh
#Modify header
set -x
HEAD=$(cat PBN2CPR1.TXT | awk 'BEGIN { FS = ","... (1 Reply)
Discussion started by: ddurden7
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am able to use sed if I hardcode the find and replace values in a shell script.
This works:
sed -e 's/123v/4567/g' /path/aaa.txt
> /path/aaa.txt.tmp
If I use a variable, I am not able to use sed command. why?
This doesnot work:
i=abc
j=bk${i}
sed -e 's/${i}/${j}/g'... (5 Replies)
Discussion started by: new_learner
5 Replies
8. Shell Programming and Scripting
Is it possible to place a variable in a sed command as such?
sed 's/ret_Priv()/$var/' <filename>
I am doing this under Bourne. (5 Replies)
Discussion started by: plslakewood
5 Replies
9. Shell Programming and Scripting
All
I am trying to produce the following in /etc/ssh/sshd_config,
# IPv4 only
#ListenAddress 0.0.0.0
# IPv4 & IPv6
ListenAddress ::
to
# IPv4 only
ListenAddress <user-entry>
ListenAddress <user-entry>
# IPv4 & IPv6
#ListenAddress ::
The number of user entries can vary.
... (1 Reply)
Discussion started by: miyoung999
1 Replies
10. Shell Programming and Scripting
Im trying to use sed to print value that matches the value in variable and all lines after that.
grep "Something" test.txt | sed -e '/{$variable}/,$b' -e 'd'
I cant get it work, if I replace the $variable with the value it contains, it works fine... (10 Replies)
Discussion started by: olkkis
10 Replies
ADDLOSIG(3) MBK LOGICAL FUNCTIONS ADDLOSIG(3)
NAME
addlosig - create a logical signal
ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in
Paris, France.
Web : http://asim.lip6.fr/recherche/alliance/
E-mail : alliance-users@asim.lip6.fr
SYNOPSYS
#include "mlo.h"
losig_list *addlosig(ptfig, index, namechain, type)
lofig_list *ptfig;
long index;
chain_list *namechain;
char type;
PARAMETERS
ptfig Pointer to the figure in which the signal should be added
index Signal index
namechain List of names of the signal
type Signal type
DESCRIPTION
addlosig creates a new signal, and adds it to the list of signals pointed to by ptfig->LOSIG. The new signal is added in front of the list,
and becomes itself the list head.
The type parameter can take two values :
EXTERNAL The signal is attached to at least one connector of the figure.
INTERNAL The signal is only attached to instance or transistor connector.
The index and type arguments fill the INDEX and TYPE fields of the losig(3) structure. The index is the signal identifier, so it should be
unique at a given hierarchical level.
The namechain argument is a list of names, given in a chain_list. See chain(3) for details.
RETURN VALUE
addlosig returns a pointer to the newly created signal.
ERRORS
"*** mbk error *** addlosig impossible signal index already exist in figure ptfig->NAME"
The index is already used in an other signal, and since it's the signal identifier, it can't be.
EXAMPLE
#include "mlo.h"
losig_list *merge_and_create(pt, s0, s1) /* merge two signal in a third */
lofig_list *pt;
losig_list *s0, *s1;
{
chain_list *c;
losig_list *s;
long max_index;
/* merge names */
for (c = s0->NAMECHAIN; c; c = c->NEXT)
s1->NAMECHAIN = addchain(s1->NAMECHAIN, c);
/* find maximum index */
for (s = pt->LOSIG; s; s = s->NEXT)
if (max_index < s->INDEX)
max_index = s->INDEX;
s = addlosig(pt, ++max_index, s1->NAMECHAIN,
s0->TYPE == EXTERNAL || s1->TYPE == EXTERNAL ?
EXTERNAL : INTERNAL);
dellosig(pt, s0);
dellosig(pt, s1);
return s;
}
SEE ALSO
mbk(1), lofig(3), losig(3), getlosig(3), dellosig(3).
BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory.
We need your feedback to improve documentation and tools.
ASIM
/LIP6 October 1, 1997 ADDLOSIG(3)