Hi there. If variables are named inside of a ksh script, how is it possible to pass these to sed?
The affected portion of my script goes something like this:
A=`cut -d. -f1 $FILE`
B=`cut -d. -f2 $FILE`
C=`cut -d. -f3 $FILE`
sed 's/1111/$A/g;s/2222/$B/g;s/3333/$C/g' file > anotherfile
... (2 Replies)
Hi, Thanks for looking,,,,
(kornshell)
tmp3 is a list of line numbers
I want to print the lines from my list
code:
while read j
do
echo $j #works fine
echo $filename #works fine
#sed "'$jp'" "$filename" ... (7 Replies)
Hello,
I'd like to pass a variable to a sed command in a perl script. The script is like this :
#!/usr/bin/perl -w
$newline="new";
system q(sed '/insert/ i\ '$newline <sed1.txt >sed2.txt);
But the interpretor wouldn't recognize $newline, it inserts a "\n" instead.
I've also... (4 Replies)
Hi All,
I have a doubt.
Can we assign a regular expression for pattern searching to a variable in a script and then use that variable in place of a regular expression in sed command.I tried but got some syntax error!!Is it not possible.Because my requirement is that i have a generic script to get... (8 Replies)
hi all
is possible to pass shell (bash) variable to sed like it is in awk?
example:
awk script is storred in awk.awk file and I am passing variable called var to this file.
$ cat awk.awk
{if ($5==var) print $0}
so it works when i issue
$ bash_var=24
$ ls -l | awk -v... (1 Reply)
I have to pass a sentence in a file, the specs are as:
cat run | sed 's/SRT/'$8'/g' | sed 's/plength/68/g' | sed 's/stcol/'$5'/g' | sed 's/encol/'$6'/g' | sed 's/brdtype/'$1'/g' | sed 's/brdtxt/'$3'/g' | sed 's/demotxt/Total '$2'/g' | sed 's/bantxt/ban_'$7'/g' | sed 's/validcodes/'$4'/g' > runx... (1 Reply)
I want to send value obtained from one command(left of |) to another command that is on right of the first one (right of |) for the following two commands:
raw=`ls <directory> | grep <files_name part>`
raw=${raw:0:4} (4 Replies)
num=10
sed -n '$num p' test.txt
sed -n '10 p' test.txt works
however i am putting the sed command in a loop and the line number is not static
Can someone please help me how to achive this. (1 Reply)
My script(ksh) works fine for
---------------------------------------------------
sed -n '28,31p' ${l_name} >> ${LOG_DIR}/Email.txt
---------------------------------------------------
But I wand to pass parrmeter to this syntax
I did the following things ... (14 Replies)
working on script and saving ftp log
before log save want to remove the password
password appears after constant "PASS"
thanks
pp (1 Reply)
Discussion started by: ppaprota
1 Replies
LEARN ABOUT V7
term
TERM(7) Miscellaneous Information Manual TERM(7)NAME
terminals- conventional names
DESCRIPTION
These names are used by certain commands and are maintained as part of the shell environment (see sh(1),environ(5)).
1620 DIABLO 1620 (and others using HyType II)
1620-12 same, in 12-pitch mode
300 DASI/DTC/GSI 300 (and others using HyType I)
300-12 same, in 12-pitch mode
300s DASI/DTC 300/S
300s-12 same, in 12-pitch mode
33 TELETYPE(R) Model 33
37 TELETYPE Model 37
40-2 TELETYPE Model 40/2
43 TELETYPE Model 43
450 DASI 450 (same as Diablo 1620)
450-12 same, in 12-pitch mode
450-12-8 same, in 12-pitch, 8 lines/inch mode
735 Texas Instruments TI735 (and TI725)
745 Texas Instruments TI745
dumb terminals with no special features
hp Hewlett-Packard HP264? series terminals
4014 Tektronix 4014
tn1200 General Electric TermiNet 1200
tn300 General Electric TermiNet 300
vt05 Digital Equipment Corp. VT05
Commands whose behavior may depend on the terminal accept arguments of the form -Tterm, where term is one of the names given above. If no
such argument is present, a command may consult the shell environment for the terminal type.
SEE ALSO stty(1), tabs(1), plot(1), sh(1), environ(5)troff(1) for nroff
BUGS
The programs that ought to adhere to this nomenclature do so only fitfully.
TERM(7)