Search Results

Search: Posts Made By: mandriver
6,701
Posted By mandriver
Thanks avronius and Ikon, great stuff. I...
Thanks avronius and Ikon, great stuff.

I also managed to get it working with this:

grep -o "[[:graph:]]*@[[:graph:]]*" input_file | awk -F"@" '{print $1}' > output_file

Thanks alot :b:
6,701
Posted By mandriver
Finding an email address
Hi all,

I have a file with X number of lines.
Somewhere within each line will be an email address following the format:

<telephone_number>@domain.net

Each line is not a set length and...
3,713
Posted By mandriver
The output is fine, it's only when I attempt to...
The output is fine, it's only when I attempt to name the file created using a variable that it creates and empty file.

I have gotten around this by writing to a file named in a standard manner,...
3,713
Posted By mandriver
hi guys, thanks for the responses. The...
hi guys, thanks for the responses.

The below works fine with a simple command such as ls -l:

ls -l > ${MYVAR}.arc

But when I attempt to send the output of an awk command to a similarly...
3,713
Posted By mandriver
Hi Frank, thanks for the reply. The variable...
Hi Frank, thanks for the reply.

The variable is set, but the file gets created without the extension
3,713
Posted By mandriver
Piping to a file and setting filename using a variable
Hi all,

I would like to send the output of a line in a ksh script to a file, but I need to name the file using a predefined variable:

ls -l > $MYVAR.arc

But what is the correct syntax for...
5,194
Posted By mandriver
That's done it! awk -v s=$string...
That's done it!


awk -v s=$string 'BEGIN{FS=OFS="|"}!/T00:00:00/{$NF=s}1'


Perfect, thank you Franklin! :b:

(It seems to work fine replacing the last field, I believe the field is...
5,194
Posted By mandriver
Nearly there: awk -F"|" -v s=$string...
Nearly there:

awk -F"|" -v s=$string '!/T00:00:00/{$NF=s}1' file > newfile

(Forgot to mention that each line in the file has | as the field delimiter).

This line is writing $string to the...
5,194
Posted By mandriver
Thanks Franklin Nearly there, but $string...
Thanks Franklin

Nearly there, but $string is being written one-space into the beginning of the line, not at the end.

Trying to work it out but haven't cracked it yet!
5,194
Posted By mandriver
bash shell script
bash shell script
5,194
Posted By mandriver
Thanks guys for your replies, but unfortunately...
Thanks guys for your replies, but unfortunately it's still not writing the string to the end of the file.

It gets past the parser, and the rest of the script executes without problem, but no...
5,194
Posted By mandriver
Need assistance with appending strings using sed and variables
HI,

Can't seem to find anything on the forums to fix this.

I have a file, one line within this will not have a specific string at the end.

I have the string, but need to append it to the...
Showing results 1 to 12 of 12

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