| slystoner 2006-12-11, 7:23 pm |
| slystoner ha scritto:
> cat file | awk {' print $4" "$5" "$6" "$7" "$8" "$9" ... $n '}
>
>
> Where n is a number that I guess large to be sure that all rest ot the
> line will be printed
>
>
> esample:
>
> INPUT FILE:
> I don't like 2 2 2 2 2 2222222 2 2 22 2 2 2
> one two tree 11111111 111111 1111 111111 11 1 1 1
> hey! hey! hey! BLA BLA BLA BLAAAAA B B B B B
>
> OUTPUT:
> 2 2 2 2 2 2222222 2 2 22 2 2 2
> 11111111 111111 1111 111111 11 1 1 1
> BLA BLA BLA BLAAAAA B B B B B
If the input contains directories and files and I want to remove them
from filesystem, es:
INPUT file:
addUrl BLA BLA "/home/geeky/CCCP.java"
addUrl HMM HMM "/tmp/this is a directory/"
addUrl AIB BAI "/c64/p i n k f l a m i n g o s.sid"
This is my dummy code:
cat "$1" | grep addUrl | cut -d' ' -f4- | while read line; do ls
"$line"; done
(then I will substitute 'ls' with 'rm -r' when it will runs)
but running it, it says:
ls: "/home/geeky/CCCP.java": No such file or directory
etc
and the file exists!
|