Results 1 to 2 of 2
Hello.
I have the following lines in a for loop, that runs through a list
of email accounts and puts it in a file. I want to have the domain ...
- 10-23-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 1
Bash: awk string help
Hello.
I have the following lines in a for loop, that runs through a list
of email accounts and puts it in a file. I want to have the domain added
to start of every line in the output.
I want to somehow include the $domain in the print, before the $1Code:domain=`mynameATemail.com | cut -d 'AT' -f2` #removes the AT and chars before it grep $ACCOUNTS | awk {'print $1 "," $2/1024/1024 "," $3/1024/1024'} >> file.csv
and cant figure out how todo this..
So code should look something like this:
But that gives error on the 'AT'...Code:grep $ACCOUNTS | awk {'print $1 | cut -d 'AT' -f2 "," $1 "," $2/1024/1024 "," $3/1024/1024'} >> file.csv
Anyone out there that have any good solutions?
Note: Had to change out the AT sign with AT,
was not allowed to post with the AT sign
Thank you in advanced.
/Sithz
- 10-23-2009 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Code:awk -v DOMAIN=$domain {'print DOMAIN $1 "," $2/1024/1024 "," $3/1024/1024'} >> file.csv


Reply With Quote