Hello, On Fri, 18 May 2018, Per Jessen wrote:
When I run:
myexecutable --config=~/job00001.conf
from the bash command line, surely am I right to expect ~/job00001.conf to be resolved to "/home/per/job00001.conf" ?
==== man bash ==== DEFINITIONS [..] word A sequence of characters considered as a single unit by the shell. Also known as a token. [..] EXPANSION [..] Tilde Expansion If a word begins with an unquoted tilde character (`~'), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [..] If this login name is the null string, the tilde is replaced with the value of the shell parameter HOME. [.] ==== In your case, the word is the complete '--config=~/job00001.conf' and that does not begin with the tilde. IOW: use ${HOME} if you need it inside a "word" or inside (double) quotes. Exp: $ echo myexecutable --config=~/job00001.conf myexecutable --config=~/job00001.conf $ echo myexecutable --config ~/job00001.conf myexecutable --config /home/dh/job00001.conf $ echo myexecutable "--config ~/job00001.conf" myexecutable --config ~/job00001.conf $ echo myexecutable "--config ${HOME}/job00001.conf" myexecutable --config /home/dh/job00001.conf $ echo myexecutable --config=${HOME}/job00001.conf myexecutable --config=/home/dh/job00001.conf HTH, -dnh -- "Powered-up hardware and sweat do not mix." -- Simon Cozens -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org