in reply to Re: system call (backticks) with pipes
in thread system call (backticks) with pipes
What about a mixed case? I want variable substitution in part of the command.
$boot_device = q awk 'FNR == 2 { print $1 }'; $boot_device = `$boot_device`; print "$boot_device\n"; $UUID_boot = q awk '{ print $2 }' | sed 's/"//g'; $UUID_boot = `$UUID_boot`; $print "$UUID_boot\n";
I want $boot_device to be variable expanded but I don't want $2 to be expanded. Using q, the command is being sent as
blkid $boot_device | awk '{ print $2 }' | sed 's/"//g'
Using qq the command is being sent as
blkid /dev/md126p1 | awk '{ print }' | sed 's/"//g'
which results in an error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: system call (backticks) with pipes
by Corion (Patriarch) on Nov 17, 2016 at 20:26 UTC | |
|
Re^3: system call (backticks) with pipes
by AnomalousMonk (Archbishop) on Nov 17, 2016 at 21:06 UTC | |
|
Re^3: system call (backticks) with pipes
by hippo (Archbishop) on Nov 17, 2016 at 22:32 UTC |