mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
env_parallel.bash: Allow for $array[1]-variables to be used for parset.
env_parallel: Install in .shrc.
This commit is contained in:
parent
823645285f
commit
04cca9fe43
|
@ -40,6 +40,7 @@ while test $# -gt 0; do
|
||||||
case $key in
|
case $key in
|
||||||
-i|--install)
|
-i|--install)
|
||||||
installer . env_parallel.bash $HOME/.bashrc
|
installer . env_parallel.bash $HOME/.bashrc
|
||||||
|
installer . env_parallel.sh $HOME/.shrc
|
||||||
installer . env_parallel.zsh $HOME/.zshenv
|
installer . env_parallel.zsh $HOME/.zshenv
|
||||||
installer source env_parallel.ksh $HOME/.kshrc
|
installer source env_parallel.ksh $HOME/.kshrc
|
||||||
echo $SHELL | grepq /pdksh &&
|
echo $SHELL | grepq /pdksh &&
|
||||||
|
@ -55,6 +56,7 @@ while test $# -gt 0; do
|
||||||
echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish
|
echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish
|
||||||
echo 'Installed env_parallel in: '
|
echo 'Installed env_parallel in: '
|
||||||
echo " " $HOME/.bashrc
|
echo " " $HOME/.bashrc
|
||||||
|
echo " " $HOME/.shrc
|
||||||
echo " " $HOME/.zshenv
|
echo " " $HOME/.zshenv
|
||||||
echo " " $HOME/.config/fish/config.fish
|
echo " " $HOME/.config/fish/config.fish
|
||||||
echo " " $HOME/.kshrc
|
echo " " $HOME/.kshrc
|
||||||
|
|
|
@ -206,12 +206,13 @@ parset() {
|
||||||
if [ "$_parset_name" == "" ] ; then
|
if [ "$_parset_name" == "" ] ; then
|
||||||
echo parset: Error: No destination variable given. >&2
|
echo parset: Error: No destination variable given. >&2
|
||||||
echo parset: Error: Try: >&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
|
return 255
|
||||||
fi
|
fi
|
||||||
echo "$_parset_name" |
|
echo "$_parset_name" |
|
||||||
perl -ne 'chomp;for (split /[, ]/) {
|
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: $_ is an invalid variable name.\n";
|
||||||
print STDERR "parset: Error: Variable names must be letter followed by letters or digits.\n";
|
print STDERR "parset: Error: Variable names must be letter followed by letters or digits.\n";
|
||||||
$exitval = 255;
|
$exitval = 255;
|
||||||
|
|
Loading…
Reference in a new issue