How do you store, and later execute, a command with redirection and and a pipe? (And is it the pipe, or the redirection, or both, that's causing my problem?)
I tried to print the urxvt version in a script, as well as echo the actual command.
The command I use to get the version is
urxvt -help 2>&1 | head -n 2 - for some reason, urxvt prints help to
stderr; as for the
head, only the two first rows contain version and configuration data.
In the shell, it works great, but, in the script (isolated the problem, below), it seems the third line loses its head:
#!/bin/bash VER_URXVT='urxvt -help 2>&1 | head -n 2' echo $VER_URXVT $VER_URXVT