unix - AWK Include Whitespaces in Command -
i have string: "./delivery note.doc 1" , where:
$1 = ./delivery $2 = note.doc $3 = 1
i need execute sum command concatenating $1 , $2 keeping white space (./delivery note.doc). try trim whitespaces:
| '{ command="sum -r "$1 $2"
result: ./deliverynote.doc
to execute sum command
echo "./delivery note.doc 1" | awk '{ command="sum -r \""$1" "$2"\""; print command}' | bash
Comments
Post a Comment