RE: Sed, awk? [solved]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks to everyone who posted. I never thought to use the ``. It's
just like perl and php.. Can run another program as the input. This
solved my problem.

As far as the tr command being used: why did it return different
results each time? I haven't seen that happen during the times I've
run it. Here is what I get:

[root@ntlh spam]# grep 'info3@' * | cut -f 1 -d : | tr \\012 \\40

hBIHk1pW014537 hBIHk1pW014537 hBIHk1pW014537 hBIIIFpW015691
hBIIIFpW015691 hBIIIFpW015691 hBIJjspW018737 hBIJjspW018737
hBIJjspW018737 hBIJTvpW018192 hBIJTvpW018192 hBIJTvpW018192
hBIKCvpW019830 hBIKCvpW019830 hBIKCvpW019830 hBIKmppW020856
hBIKmppW020856 hBIKmppW020856 hBIKRUpW020221 hBIKRUpW020221
hBIKRUpW020221 hBIME1pW024484 hBIME1pW024484 hBIME1pW024484
hBIMZFpW025094 hBIMZFpW025094 hBIMZFpW025094 hBINOYpW026189
hBINOYpW026189 hBINOYpW026189 [root@ntlh spam]# grep 'info3@' * | cut
-f 1 -d : | tr \\012 \\40
hBIHk1pW014537 hBIHk1pW014537 hBIHk1pW014537 hBIIIFpW015691
hBIIIFpW015691 hBIIIFpW015691 hBIJjspW018737 hBIJjspW018737
hBIJjspW018737 hBIJTvpW018192 hBIJTvpW018192 hBIJTvpW018192
hBIKCvpW019830 hBIKCvpW019830 hBIKCvpW019830 hBIKmppW020856
hBIKmppW020856 hBIKmppW020856 hBIKRUpW020221 hBIKRUpW020221
hBIKRUpW020221 hBIME1pW024484 hBIME1pW024484 hBIME1pW024484
hBIMZFpW025094 hBIMZFpW025094 hBIMZFpW025094 hBINOYpW026189
hBINOYpW026189 hBINOYpW026189 [root@ntlh spam]# grep 'info3@' * | cut
-f 1 -d : | tr \\012 \\40
hBIHk1pW014537 hBIHk1pW014537 hBIHk1pW014537 hBIIIFpW015691
hBIIIFpW015691 hBIIIFpW015691 hBIJjspW018737 hBIJjspW018737
hBIJjspW018737 hBIJTvpW018192 hBIJTvpW018192 hBIJTvpW018192
hBIKCvpW019830 hBIKCvpW019830 hBIKCvpW019830 hBIKmppW020856
hBIKmppW020856 hBIKmppW020856 hBIKRUpW020221 hBIKRUpW020221
hBIKRUpW020221 hBIME1pW024484 hBIME1pW024484 hBIME1pW024484
hBIMZFpW025094 hBIMZFpW025094 hBIMZFpW025094 hBINOYpW026189
hBINOYpW026189 hBINOYpW026189 [root@ntlh spam]# grep 'info3@' * | cut
-f 1 -d : | tr \\012 \\40
hBIHk1pW014537 hBIHk1pW014537 hBIHk1pW014537 hBIIIFpW015691
hBIIIFpW015691 hBIIIFpW015691 hBIJjspW018737 hBIJjspW018737
hBIJjspW018737 hBIJTvpW018192 hBIJTvpW018192 hBIJTvpW018192
hBIKCvpW019830 hBIKCvpW019830 hBIKCvpW019830 hBIKmppW020856
hBIKmppW020856 hBIKmppW020856 hBIKRUpW020221 hBIKRUpW020221
hBIKRUpW020221 hBIME1pW024484 hBIME1pW024484 hBIME1pW024484
hBIMZFpW025094 hBIMZFpW025094 hBIMZFpW025094 hBINOYpW026189
hBINOYpW026189 hBINOYpW026189 [root@ntlh spam]# grep 'info3@' * | cut
-f 1 -d : | tr \\012 \\40
hBIHk1pW014537 hBIHk1pW014537 hBIHk1pW014537 hBIIIFpW015691
hBIIIFpW015691 hBIIIFpW015691 hBIJjspW018737 hBIJjspW018737
hBIJjspW018737 hBIJTvpW018192 hBIJTvpW018192 hBIJTvpW018192
hBIKCvpW019830 hBIKCvpW019830 hBIKCvpW019830 hBIKmppW020856
hBIKmppW020856 hBIKmppW020856 hBIKRUpW020221 hBIKRUpW020221
hBIKRUpW020221 hBIME1pW024484 hBIME1pW024484 hBIME1pW024484
hBIMZFpW025094 hBIMZFpW025094 hBIMZFpW025094 hBINOYpW026189
hBINOYpW026189 hBINOYpW026189 [root@ntlh spam]# grep 'info3@' * | cut
-f 1 -d : | tr \\012 \\40
hBIHk1pW014537 hBIHk1pW014537 hBIHk1pW014537 hBIIIFpW015691
hBIIIFpW015691 hBIIIFpW015691 hBIJjspW018737 hBIJjspW018737
hBIJjspW018737 hBIJTvpW018192 hBIJTvpW018192 hBIJTvpW018192
hBIKCvpW019830 hBIKCvpW019830 hBIKCvpW019830 hBIKmppW020856
hBIKmppW020856 hBIKmppW020856 hBIKRUpW020221 hBIKRUpW020221
hBIKRUpW020221 hBIME1pW024484 hBIME1pW024484 hBIME1pW024484
hBIMZFpW025094 hBIMZFpW025094 hBIMZFpW025094 hBINOYpW026189
hBINOYpW026189 hBINOYpW026189 



Both of the grep lines work equally well on my RH9 system. Since I was
initally looking for the shortest, I was going to use the above line,
but since you experianced problems, I may just put the other into
another bash file and end up just doing:

spam.spam `find.spam info3@`


Just create the find.spam file the same as the spam.spam and spam.ham
files.



As far as the 1024 arg limit: I'm running the stock RH9 kernel, so
this may be a problem. Could you explain further how I could use xargs
to do the same? I'm not writing directly to a file, inside the
spam.spam and spam.ham files is the command sa-learn which reads all
of the arguments passed into it as filenames. So I'm still working
with the limitation unless I rewrite sa-learn, correct? I'm not sure
if you have used sa-learn, but it is called like:

sa-learn --spam --(other args) file1 file2 file3 file4 ..... The
filenames are what I'm passing into it via the grep commands.



Thanks,

Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com




-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux