Reputation: 317
There's this line I want to use in a ksh script :
find . -type f -exec echo "{} $comment" | awk '{printf "%-30s %s", $1, $2}' \;
Without the awk, this line is working great :
find . -type f -exec echo "{} $comment" \;
When I added the awk to make columns, I had this error :
awk: fatal: cannot open file `;' for reading (No such file or directory)
find: missing argument to `-exec'
I don't find the good syntax. Do you, guys, have any idea ?
Thanks !
Upvotes: 1
Views: 1412
Reputation: 58508
This might work for you:
find . -type f -exec printf "%-30s %s\n" "{}" "$comment" \;
Upvotes: 0
Reputation: 21990
There a 2 things that I actually cannot understand.
What is \;
stand for?
What is -
for in printf "%-30s %s", $1, $2
?
Anyway, try that.
$> find . -type f -exec echo "{} $comment" \; | awk '{printf "%30s %s\n", $1, $2}'
Upvotes: 1