in reply to Any tips on passing bash variables as arguments to a perl script (that contain spaces and/or non-ascii characters)

http://perldoc.perl.org/perlrun.html#%23!-and-quoting-on-non-Unix-systems, http://www.gnu.org/software/bash/manual/bashref.html#Quoting
  • Comment on Re: Any tips on passing bash variables as arguments to a perl script (that contain spaces and/or non-ascii characters)

Replies are listed 'Best First'.
Re^2: Any tips on passing bash variables as arguments to a perl script (that contain spaces and/or non-ascii characters)
by wrog (Friar) on Apr 17, 2015 at 05:27 UTC
    since the question is about about Linux and bash, you can probably skip the page about quoting on non-Unix systems; the bash manual is what you want. Most of the time, putting the arguments in double quotes does what you want, e.g.,
    scriptname ... "${OPC_MSG_TXT}"
    will ensure that whatever $OPC_MST_TXT expands to ends up as a single positional parameter