Search Results

Search: Posts Made By: sugan
6,654
Posted By sugan
Thank you very much. It works. It would be...
Thank you very much. It works. It would be great if you can explain how it works.
6,654
Posted By sugan
You are right. It works. I am actually trying to...
You are right. It works. I am actually trying to format the output using awk and printf. That is where the words/phrases after 4th feild gets erased.

My code is:
Line="# IN01379 Larry ...
6,654
Posted By sugan
The input line is given below: # IN01379 ...
The input line is given below:
# IN01379 Larry 2010/03/17 (should be the same as FIW-LR AM)

The desired output is:
# IN01379 Larry 2010/04/26 (should be the same as...
6,654
Posted By sugan
Awk to replace a field
Hi
I am using awk to replace the 4th feild of the input line. My code is below:

REP_LINE=$(echo $Line | awk -v var=$REPL_DT '{$4=var; print}')

It does replaces but all words/phrases after...
4,254
Posted By sugan
Using 'su' inside a loop
Hi,
I am using su within a for loop. As you might expect, it prompts for password during each loop execution. Here is my piece of code:

for i in $LIST
do
if [ `echo $i | grep -c 'APSTAGE'`...
3,323
Posted By sugan
Sorry. This code does work! su - apstage...
Sorry.
This code does work!

su - apstage -c "cd /home/apstage/src/util; . GHD_common.ksh; db_connect -c FIWLRAP"


Thanks so much.
3,323
Posted By sugan
No. I do not have sudo installed as well. ...
No. I do not have sudo installed as well.
Any way to do it without expect or sudo?
3,323
Posted By sugan
Switch to different user without expect
Hi,
I have to switch to a different user and execute certain commands and then come back to the original user

Ex: My id is 'usstage'. I need to switch to 'apstage', souce a script there,...
4,381
Posted By sugan
Hi, Your code is working fine. Thanks so much.
Hi,
Your code is working fine. Thanks so much.
4,381
Posted By sugan
Variable substitution in awk
Hi,
I have a variable to be substituted in awk. I am using AIX 5.3. Here is my piece of code:

REPL_DT=`date +'%Y\\\\\\\\\/%m\\\\\\\\\/%d'`
NEW_LINE=$(echo $Line | awk '{sub ($4, '$REPL_DT');...
2,202
Posted By sugan
The output in the tmp file should be the same...
The output in the tmp file should be the same with the 4th feild changed. I am using sed to replace the existing line with the new line. When the new line has dates in the format 'yyyy/mm/dd' sed...
2,202
Posted By sugan
Thanks very much. It works. But I got into...
Thanks very much. It works. But I got into another problem.
Here is my code:
NEW_LINE=`echo $Line | awk '{sub ($4, "2010\\\/04\\\/07"); printf "# %-7s %9s %18s\n", $2,$3,$4}' {$1=$2=$3=$4=""; sub("...
2,202
Posted By sugan
Sorry. I cant understand what you are saying. ...
Sorry. I cant understand what you are saying.

I have a line with many feilds; I need to modify the 4th feild, format the 2, 3, and 4th feild and want to print the rest of the line (other feilds...
2,202
Posted By sugan
problem with awk usage
I have to change the 4th feild of a line; Most of the time, the line has only 4 feilds, but sometimes, it has more than 4 feilds.

I am using the below command:
NEW_LINE=`echo $Line | awk '{sub...
4,771
Posted By sugan
I found out the problem. # usa4914 Joe ...
I found out the problem.

# usa4914 Joe 2010/02/17
# x3a4914 Joe 2010/02/17
# seh Lane 2010/02/17
# IN01379 Larry 2010/02/17
# IN01379 ...
7,257
Posted By sugan
Ya, its working fine. Thanks
Ya, its working fine. Thanks
7,257
Posted By sugan
String formatting using awk printf
Hi Friends,
I am trying to insert lines of the below format in a file:

# x3a4914 Joe 2010/04/07
# seh Lane 2010/04/07
# IN01379 Larry 2010/04/07


I am...
4,771
Posted By sugan
Error message while using awk
Hi Friends,
I am using the below code in my script:

elif [ $1 != 'Cindy' -a `echo $Line | grep -ce 'Larry' -e 'Joe' -e 'Bryan' -e 'Lane'` -gt 0 ]
then
NEW_LINE=`echo $Line | awk...
1,822
Posted By sugan
Great! It works. Thank you :)
Great! It works. Thank you :)
1,822
Posted By sugan
String formatting using AWK
Hi,
I need to insert a line at a particular line number. I am using the below code:

sed $REV_LINO_NO" i\\
# $CURRENT_DATE $NAME Changed pwd for cindy\'s id" file > file1


This...
Forum: AIX 04-01-2010
24,675
Posted By sugan
You are a UNIX Genius!!! Thank you very much :)
You are a UNIX Genius!!!
Thank you very much :)
Forum: AIX 04-01-2010
24,675
Posted By sugan
AIX version 5.3 Even if you have any other...
AIX version 5.3
Even if you have any other solution other than sed, pls let me know
Forum: AIX 04-01-2010
24,675
Posted By sugan
They are two different variable substitutions in...
They are two different variable substitutions in sed. The first post was for inserting a line using sed at a specific line number, which was a variable.

Now, I am trying to insert a line, which...
Forum: AIX 04-01-2010
24,675
Posted By sugan
insert a line with variables using sed
Hi,
I have to insert a line having variables using sed. But the variables are not getting substituted within sed.

Ex:
n=2
sed $n' i\
hi' file

This works. But the below code does not work....
6,053
Posted By sugan
Thanks a lot Pludi. Your solution works!!!
Thanks a lot Pludi. Your solution works!!!
Showing results 1 to 25 of 26

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