Search Results

Search: Posts Made By: TasosARISFC
12,407
Posted By CarloM
*&^£$%& IBM! :) How about: find $1 -type d...
*&^£$%& IBM! :)

How about:
find $1 -type d \( \! -name '*\.gz' \) -print | grep -v ^$1$
12,407
Posted By CarloM
Try find $1 -type d \( \! -name '*\.gz' \) \(...
Try
find $1 -type d \( \! -name '*\.gz' \) \( \! -samefile $1 \) -print
12,407
Posted By CarloM
iirc AIX tar has a zip option, but I forget what...
iirc AIX tar has a zip option, but I forget what it was...

A simple way could be:
#!/bin/ksh

for i in $( find $1 -type d -mtime +$2 -print )
do
tar cpf "$i.tar" "$i"
gzip...
12,407
Posted By Skrynesaver
It's simply a matter of parameters, gzip takes a...
It's simply a matter of parameters, gzip takes a filename and zips it up replacing the original file with the zipped file and adding the .gz exception.

The tar command on the other hand needs to...
12,407
Posted By CarloM
That's because you're telling it to write to a...
That's because you're telling it to write to a tar file named 'Nov2010' (tar -f <filename>) - tar doesn't automatically add a suffix.

tar -cvpzf {}.tar.gz might work
12,407
Posted By mirni
Your problem is that you are trying to create a...
Your problem is that you are trying to create a file (archive) with the same name as directory that you are compressing. Remember though, that directories in UNIX are just files, and you cannot...
1,431
Posted By rangarasan
Hi, just try this, grep 'inID' $line |...
Hi,
just try this,

grep 'inID' $line | nawk '{split($0,a,"inID=\"");b=substr(a,0,8);print b;}'


cheers,
Ranga:-)
1,431
Posted By itkamaraj
not tested... nawk ' /inID/...
not tested...
nawk ' /inID/ {for(i=1;i<=NF;i++){if($i~/inID/) {print $i}}' xmlfile
2,038
Posted By yazu
AFAIK, according POSIX standard this is not a...
AFAIK, according POSIX standard this is not a text file. You can get some problems working with it (for example "cat THISFILE | while read line; do echo $line; done" wouldn't emit the last line)....
2,038
Posted By birei
Hi, Try next command: $ perl -pe 'chomp...
Hi,

Try next command:

$ perl -pe 'chomp if eof' infile
Regards,
Birei
4,763
Posted By Chubler_XL
The ls | grep wasn't entirly useless it was...
The ls | grep wasn't entirly useless it was testing for existance of a file matching the glob to avoid issues if no TEST_* files are in the dir.

TasosARISFC, the {stuff} was supposed to be your...
4,763
Posted By Corona688
You really can't edit-in-place like that. awk...
You really can't edit-in-place like that. awk doesn't work that way. It'll either do nothing, or trash the entire file.

Just print in awk instead of printing to file, and do the redirection...
4,763
Posted By in2nix4life
Hope this helps. awk...
Hope this helps.

awk 'BEGIN{OFS=FS="|"}$11=="to follow"||$11=="tbc"||$11=="123456"{$11=" "}{print}' < file > newfile
3,820
Posted By panyam
Does this help awk -v c=0 -F"|"...
Does this help


awk -v c=0 -F"|" '/HEADER/ { $2=c;print ; prev=c ; c=c+1 ;next} {$2=prev;print}' OFS="|" input_file
3,820
Posted By vgersh99
true, but the OP's description and the sample...
true, but the OP's description and the sample input/output contradict each other as well.
Given the 'description', here's the modified code:

nawk '$3=="HEADER" {$2=c++}$2=c' FS='|' OFS='|' myFile
Showing results 1 to 15 of 15

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