10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Experts,
Can someone help me with the below?
I've a variable called NSPMHOME=some_value. I would like change the value of the variable with another variable and something followed by it.
E.g
From NSPHOME=some_value to NSPMHOME=$SOMETHING/test
$SOMETHING has value /opt/tag .
The end... (4 Replies)
Discussion started by: jawaugh
4 Replies
2. Shell Programming and Scripting
input.txt
I want to make 3 seprate ouputs such that
toast1.txt
ICH.txt
ICH_SV.txt
I have tried "echo" and "sed 's/k/toast1/g' to replace k, but its not quite working. Please help me out :)
Thanks! (4 Replies)
Discussion started by: johnkim0806
4 Replies
3. Shell Programming and Scripting
Hi all,
I have a script in file1 which gets input from the user say variable "TYPE". This variable is present in the other file2. I want to replace the variable in the file2 with the value given by the user and print the file. How can I achieve this task?
file1
code
echo "Give... (3 Replies)
Discussion started by: Ananthdoss
3 Replies
4. Shell Programming and Scripting
Hi All,
As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2
e.g.
file 1
wqwert
4.4464002
3
319
286
369
46.320002
56.150002
45.100002
1
1
1
0.723 (12 Replies)
Discussion started by: f_o_555
12 Replies
5. Shell Programming and Scripting
Hi guys
In my shell script I have a variable that contains a string that contains the current time.
I want to replace the spaces and colons in the value with underscores.
TIME=`date`
echo $TIME
gives me: Thu Sep 24 16:40:53 BST 2009
I want it to show:... (4 Replies)
Discussion started by: alinaqvi90
4 Replies
6. UNIX for Dummies Questions & Answers
Hi,
If I have a variable
var1 ='TH 12/1234'
How can I set this too in a script
var1 ='TH 12~1234'
Bearing in mind "/" might be in a difference place each time and that the "/" might not even exist each time
the variable is set.
Thanks (3 Replies)
Discussion started by: belfastbelle
3 Replies
7. Shell Programming and Scripting
ip1="xxx"
ip2="bbb"
sed 's/$ip1/$ip2/g' (3 Replies)
Discussion started by: shivarajM
3 Replies
8. Shell Programming and Scripting
Input file - tmp
<begin>
./00003/
./00004/
<end>
I would like to replace "." with the value of pwd
so that the output will look like
/dev/project/00003/
t=`pwd`
sed -e "s/\./$t/g" tmp > tmp1;
The above piece of code is not working. Appreciate your help. (4 Replies)
Discussion started by: lotto_123
4 Replies
9. UNIX for Dummies Questions & Answers
hi
I have a variable like
k=$DESTDIR/$PKG/$VERSION
I want to replace each $ in string k with say "XXX".
so that k becomes like this "XXXDESTDIR/XXXPKG/XXXVERSION"
when I use echo $k | sed -e "s/\$/XXX" it actually passes expanded of variables $DESTDIR, $PKG and $VERSION to sed.
... (10 Replies)
Discussion started by: ashish_uiit
10 Replies
10. Shell Programming and Scripting
My String variable is holding value as - abc"def
I want to replce " with \"
I tried with awk :
echo $var | awk '{gsub(/"/,"\"");print}'
and I am getting an error, `)' is not expected. (1 Reply)
Discussion started by: videsh77
1 Replies