Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh adding single quotes as it pleases



I suspect you want to do something like this:

function printargs () {                                      
  local x i=0 n            
  n=$1 ; shift
  for x in $@ ; do
    echo "${n}[$((i++))]: $x"
  done
}

cat ll.txt | sed -e '/^\ *\#/d' | while IFS='' read line ; do
  echo "line= $line"
  eval printargs arg $line
done

output:

line= -a p1vkg/Bis1234/"XXXXXXXX XXXXXXX XX"
arg[0]: -a
arg[1]: p1vkg/Bis1234/XXXXXXXX XXXXXXX XX
line= -a r0esmm/Bis1234/"XXX XXX - XXXX"
arg[0]: -a
arg[1]: r0esmm/Bis1234/XXX XXX - XXXX


greg



Messages sorted by: Reverse Date, Date, Thread, Author