diff --git a/src/env_parallel b/src/env_parallel index 632a919c..122a25aa 100755 --- a/src/env_parallel +++ b/src/env_parallel @@ -40,6 +40,7 @@ while test $# -gt 0; do case $key in -i|--install) installer . env_parallel.bash $HOME/.bashrc + installer . env_parallel.sh $HOME/.shrc installer . env_parallel.zsh $HOME/.zshenv installer source env_parallel.ksh $HOME/.kshrc echo $SHELL | grepq /pdksh && @@ -55,6 +56,7 @@ while test $# -gt 0; do echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish echo 'Installed env_parallel in: ' echo " " $HOME/.bashrc + echo " " $HOME/.shrc echo " " $HOME/.zshenv echo " " $HOME/.config/fish/config.fish echo " " $HOME/.kshrc diff --git a/src/env_parallel.bash b/src/env_parallel.bash index e39facf9..6751e437 100755 --- a/src/env_parallel.bash +++ b/src/env_parallel.bash @@ -206,12 +206,13 @@ parset() { if [ "$_parset_name" == "" ] ; then echo parset: Error: No destination variable given. >&2 echo parset: Error: Try: >&2 - echo parset: Error: ' ' parset myvar echo ::: foo >&2 + echo parset: Error: ' ' parset myarray echo ::: foo bar >&2 return 255 fi echo "$_parset_name" | perl -ne 'chomp;for (split /[, ]/) { - if(not /^[a-zA-Z_][a-zA-Z_0-9]*$/) { + # Allow: var_32 var[3] + if(not /^[a-zA-Z_][a-zA-Z_0-9]*(\[\d+\])?$/) { print STDERR "parset: Error: $_ is an invalid variable name.\n"; print STDERR "parset: Error: Variable names must be letter followed by letters or digits.\n"; $exitval = 255;