because i haven’t found a solution on google or the searchfunction i will ask here.
Here is my code :
Send="last -n 1 $1 | awk '{ print $1 " " $2 }'"
My problem is, that my shell script is using parameters.
When i’m calling my script:
myScript hello world
Then my awk-Command looks like
awk '{ print hello " " world }'
But how could I avoid this? is there a way?
Because this is a part of a project, i couldn’t post more code. ;/
first change the outer “‘s to
$()so:send=$(last -n 1 $1 | awk '{print $1 " " $2}')use the
FS(field separator) variable which defaults to space in awk instead of ” ” for a space so:send=$(last -n 1 $1 | awk '{print $1 FS $2}')