You need to do the arithmetic separately, sed doesn't know how to subtract. awk does know; do you get an error message or does it just not do what you want? Maybe you need mawk/nawk/gawk/XPG4 awk if your default awk is a really old "traditional" awk.
For the awk command I didn't get an error message but it didn't do what I wanted.
However, I've played around with the code you provided and I got it to work accordingly.
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)
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)
Hi guys,
I want to replace certain values with the number 1.
But it is also replacing other values which contain the value I want to replace. e.g.:
I want to replace ID-INTERNAL with 1, that's no problem but it will also replace ID-INTERNAL-NON-REM with 1-NON-REM
I don't want to... (10 Replies)
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)
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)
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)
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)
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)
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
LEARN ABOUT BSD
ucblinks
ucblinks(1B) SunOS/BSD Compatibility Package Commands ucblinks(1B)NAME
ucblinks - adds /dev entries to give SunOS 4.x compatible names to SunOS 5.x devices
SYNOPSIS
/usr/ucb/ucblinks [-e rulebase] [-r rootdir]
DESCRIPTION
ucblinks creates symbolic links under the /dev directory for devices whose SunOS 5.x names differ from their SunOS 4.x names. Where possi-
ble, these symbolic links point to the device's SunOS 5.x name rather than to the actual /devices entry.
ucblinks does not remove unneeded compatibility links; these must be removed by hand.
ucblinks should be called each time the system is reconfiguration-booted, after any new SunOS 5.x links that are needed have been created,
since the reconfiguration may have resulted in more compatibility names being needed.
In releases prior to SunOS 5.4, ucblinks used a nawk rule-base to construct the SunOS 4.x compatible names. ucblinks no longer uses nawk
for the default operation, although nawk rule-bases can still be specifed with the -e option. The nawk rule-base equivalent to the SunOS
5.4 default operation can be found in /usr/ucblib/ucblinks.awk.
OPTIONS -e rulebase Specify rulebase as the file containing nawk(1) pattern-action statements.
-r rootdir Specify rootdir as the directory under which dev and devices will be found, rather than the standard root directory /.
FILES
/usr/ucblib/ucblinks.awk sample rule-base for compatibility links
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO devlinks(1M), disks(1M), ports(1M), tapes(1M), attributes(5)SunOS 5.10 13 Apr 1994 ucblinks(1B)