Search Results

Search: Posts Made By: gotamp
1,979
Posted By gotamp
sed not working properly with slash /
my testfile is

aspsun1:usasp000$cat testfile
open connection
put $TMPDIR/SUNIA.PJ080202.ENGRPTBZ.<OPERATOR>.133 <FILENAME>
quit


my problem statement is to replace the line with put command...
2,260
Posted By gotamp
sorry, but it did not work . it says awk:...
sorry, but it did not work .
it says
awk: syntax error near line 1
awk: bailing out near line 1
2,260
Posted By gotamp
Need to filter the result set within 2 time frame
my sample file is like this
$cat onefile
05/21/18 13:10:07 ABRT US1CPDAY Status 1
05/21/18 21:18:54 ABRT DailyBackup_VFFPRDAPENTL01 Status 6
05/21/18 21:26:24 ABRT...
19,194
Posted By gotamp
Yes This too works. Thanks RudiC. Brilliant !!
Yes This too works.
Thanks RudiC. Brilliant !!
19,194
Posted By gotamp
Many Thanks Ravinder for the solution And...
Many Thanks Ravinder for the solution
And Thanks Rudic For the explanation.

Ravinder,
The single quote one worked.
/usr/bin/sed 's/'${a}'/'${b}'/g' /user/iomaint/tempo/gtm/sed/filetosedreplace...
19,194
Posted By gotamp
Hi RudiC Please find my shell script that...
Hi RudiC

Please find my shell script that uses sed
#!/bin/ksh
a=$1
b=$2
echo "a is $a , b is $b"
/usr/bin/sed 's/$a/$b/g' /user/iomaint/tempo/gtm/sed/filetosedreplace


and this is the...
19,194
Posted By gotamp
Thanks R.Singh for correctly pointing it out. I...
Thanks R.Singh for correctly pointing it out.
I have done the changes accordingly, but still it does not work.
Not sure, if sed could be used this way inside a shell script.

THanks
Goutam
19,194
Posted By gotamp
Using sed inside shellscript
Hi All,

I am trying to use sed command inside a shell script.
The same sed command is working on command line, however its not working while using inside a shell script.
From various sources i...
1,675
Posted By gotamp
Hi , the first portion of your problem seems...
Hi ,

the first portion of your problem seems to be a easy one.
you can use head and tail to extract the required record from the parent file and then redirect to create other files as required.
...
4,616
Posted By gotamp
Hi Puneetkhular, You can also use sed to...
Hi Puneetkhular,

You can also use sed to achieve this.

sed -n '/start time/,/endtime/p' logfile
sed -n '/05\/26\/2016 02:41:56/,/05\/26\/2016 02:41:57/p' logfile
hope, this helps.



...
12,057
Posted By gotamp
Apologies for not being clear while mentioning my...
Apologies for not being clear while mentioning my requirement.
yes actually there were number of other inputs as well those were to be rejected.
Anyways thanks for the help !!
Will try to be more...
12,057
Posted By gotamp
Many thanks Aia. now i understood, i was...
Many thanks Aia.

now i understood, i was missing the period . before *
3,163
Posted By gotamp
Question is somewhat not clear. just let us...
Question is somewhat not clear.
just let us know..
what is expected and what you are getting. may be then we can help you.
12,057
Posted By gotamp
Thanks Cragun for the response. No, its not a...
Thanks Cragun for the response.
No, its not a homework, It just came to mind and i was on it.
May be its a silly one and currently its not striking me.
Here are the ones i have tried but its not...
12,057
Posted By gotamp
Unable to grep
I have a file with 2 lines of code
Rome is in Romeo
Romeo is in Rome

How do I grep, so that only last line would be the outcome.
sample output
Romeo is in Rome

I have tried with all...
7,219
Posted By gotamp
many thanks Scrutinizer and All. The given code...
many thanks Scrutinizer and All.
The given code works fine. Actually there was another problem the file did not have a newline. I had to fold that file and then use sed.
7,219
Posted By gotamp
Replacing special character with sed
Hi All,

I have a text file that contains

I1SP2 *=*=Y=M=D001D

My requirement is to replace all occurrence of =* to =Z

expected o/p is I1SP2 *=Z=Y=M=D001D

I have tried with
sed...
7,249
Posted By gotamp
Yes Ravinder. It works. Problem stands...
Yes Ravinder. It works.

Problem stands resolved.
But just to satisfy my mind and soul if you could suggest with sed please !!
7,249
Posted By gotamp
Adding a new line after a specific line with sed
Hi All,

My requirement is to add a specific line in a file after a certain line that contains 'setenv'

the existing code is like
setenv SEQFILES "/ConvWrk/inteng03/alltars/bnymais1"

LIBDEF...
32,337
Posted By gotamp
Many thanks Ravinder, I tried this but the...
Many thanks Ravinder,

I tried this but the -i option is not working

<aspsun19:inteng03> sed -n -i 'p;3a "CHUMMA"' abc
sed: illegal option -- i


then again i tried without -i option as well...
32,337
Posted By gotamp
Insert a line of text on nth line of a file
Hi All,

I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise

My intention is to insert a line of text after 13th line of every file inside a particular directory.

While trying to do it...
3,506
Posted By gotamp
many thanks mate !! Will definitely try out...
many thanks mate !!
Will definitely try out there .once again thanks for the help !!
3,506
Posted By gotamp
many thanks Yazu. it worked now. however, I am...
many thanks Yazu. it worked now.
however, I am still struggling to understand the logic.
I am sure i will understand, but it will take little time.
I would appreciate if you can point out any URL...
3,506
Posted By gotamp
Extremely sorry for the inconvenience caused as...
Extremely sorry for the inconvenience caused as the expression was a mess due to improper code tags.
I have corrected them now.

@ yazu..
the above code did not work . it says
sed -e...
3,506
Posted By gotamp
Segregate file content using sed backreference
I have some text like
EU1BTDAT:ASSGNDD filename='$SEQFILES/SUNIA.PJ008202.CARDLIB/DATECARD'
EU1BTDATEST:ASSGNDD filename='$SEQFILES/SUNIA.PJ008202.CARDLIB/DATECARD'
EU1CLOSEDATES:ASSGNDD...
Showing results 1 to 25 of 32

 
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy