bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

is it a bug


From: Alex fxmbsw7 Ratchev
Subject: is it a bug
Date: Sat, 14 Nov 2020 20:29:29 +0100

( http://ix.io/2E6y )
as.. the +al code worked and the +al alias was defined thru it.. just gives
the shown ; error on use

   ++ BEGINFILE ii.x7yz.1

i code shortened coding codings, or at least wish to
here in my x7yz control script i '. -- +al' a ./+al file which then
sets aliases by file content, it does so
but the resulting +al alias of itself says when usage syntax error ';'
unexpected
some other aliases work tho

any ideas ?

   -- ENDFILE ii.x7yz.1   -=| 285 chars 55 words 6 lines
   ++ BEGINFILE oo.x7yz.4

root@boost:~/x7yz# . x7yz
root@boost:~/x7yz# type +al
+al is aliased to `aalres=( ) aalt=
for caali in "${!aal[@]}" ; do
 aalres[caali]=$(
  printf %s "${aal[caali]}="
  if [[ -f ${aalt:=${aald[caali]:-${aal[caali]}}} ]] ; then
   exec cat -- "$aalt"
  else
   printf -- %s "$aalt"
  fi
 ) aalt=
done
[[ -v aalres[0] ]] &&
 alias -- "${aalres[@]}" ; '
root@boost:~/x7yz# +al
bash: syntax error near unexpected token `;'
root@boost:~/x7yz#

   -- ENDFILE oo.x7yz.4   -=| 439 chars 63 words 18 lines
   ++ BEGINFILE x7yz

#!/bin/bash
self=${BASH_SOURCE##/*} self=${self+$PWD/$self} self=${self:-$BASH_SOURCE} \
dir=${self%/*} ; cd "$dir"
shopt -s extglob globstar expand_aliases
aal=( +al KWS +kw kwp )
. -- "$aal"
KWS


   -- ENDFILE x7yz   -=| 198 chars 24 words 8 lines
   ++ BEGINFILE +al

aalres=( ) aalt=
for caali in "${!aal[@]}" ; do
 aalres[caali]=$(
  printf %s "${aal[caali]}="
  if [[ -f ${aalt:=${aald[caali]:-${aal[caali]}}} ]] ; then
   exec cat -- "$aalt"
  else
   printf -- %s "$aalt"
  fi
 ) aalt=
done
[[ -v aalres[0] ]] &&
 alias -- "${aalres[@]}" ;

   -- ENDFILE +al   -=| 278 chars 42 words 13 lines
   -- END of 4 pastes ( 1200 chars 184 words 45 lines


reply via email to

[Prev in Thread] Current Thread [Next in Thread]