zsh-workers
 help / color / mirror / code / Atom feed
* Export problem
@ 2001-06-04 18:30 a normal guy
  2001-06-04 18:42 ` Geoff Wing
  0 siblings, 1 reply; 16+ messages in thread
From: a normal guy @ 2001-06-04 18:30 UTC (permalink / raw)
  To: zsh-workers

Hello:

I think this is a bug.  Under HP-UX, the following line reports
an error:

% export RUN_DATE=`date +%Y%m%e%H%M.%S`
zsh: not an identifier: 41211.52
% 

I have reproduced this using zsh -f.

I am not part of the zsh-workers mailing list and would
appreciate being CC'ed on the discussion.

Here is the output from reporter.

-------------------
# START zsh saveset
# uname:  HP-UX hpesande B.10.20 A 9000/785 2006411904 two-user
license

# Aliases.

alias run-help=man
alias which-command=whence

# Key bindings.

bindkey -N emacs
bindkey -N main
bindkey -N vicmd
bindkey -N viins

bindkey -M emacs "^@" set-mark-command
bindkey -M emacs "^A" beginning-of-line
bindkey -M emacs "^B" backward-char
bindkey -M emacs "^D" delete-char-or-list
bindkey -M emacs "^E" end-of-line
bindkey -M emacs "^F" forward-char
bindkey -M emacs "^G" send-break
bindkey -M emacs "^H" backward-delete-char
bindkey -M emacs "^I" expand-or-complete
bindkey -M emacs "^J" accept-line
bindkey -M emacs "^K" kill-line
bindkey -M emacs "^L" clear-screen
bindkey -M emacs "^M" accept-line
bindkey -M emacs "^N" down-line-or-history
bindkey -M emacs "^O" accept-line-and-down-history
bindkey -M emacs "^P" up-line-or-history
bindkey -M emacs "^Q" push-line
bindkey -M emacs "^R" history-incremental-search-backward
bindkey -M emacs "^S" history-incremental-search-forward
bindkey -M emacs "^T" transpose-chars
bindkey -M emacs "^U" kill-whole-line
bindkey -M emacs "^V" quoted-insert
bindkey -M emacs "^W" backward-kill-word
bindkey -M emacs "^X^B" vi-match-bracket
bindkey -M emacs "^X^F" vi-find-next-char
bindkey -M emacs "^X^J" vi-join
bindkey -M emacs "^X^K" kill-buffer
bindkey -M emacs "^X^N" infer-next-history
bindkey -M emacs "^X^O" overwrite-mode
bindkey -M emacs "^X^U" undo
bindkey -M emacs "^X^V" vi-cmd-mode
bindkey -M emacs "^X^X" exchange-point-and-mark
bindkey -M emacs "^X*" expand-word
bindkey -M emacs "^X=" what-cursor-position
bindkey -M emacs "^XG" list-expand
bindkey -M emacs "^Xg" list-expand
bindkey -M emacs "^Xr" history-incremental-search-backward
bindkey -M emacs "^Xs" history-incremental-search-forward
bindkey -M emacs "^Xu" undo
bindkey -M emacs "^Y" yank
bindkey -M emacs "^[^D" list-choices
bindkey -M emacs "^[^G" send-break
bindkey -M emacs "^[^H" backward-kill-word
bindkey -M emacs "^[^I" self-insert-unmeta
bindkey -M emacs "^[^J" self-insert-unmeta
bindkey -M emacs "^[^L" clear-screen
bindkey -M emacs "^[^M" self-insert-unmeta
bindkey -M emacs "^[^_" copy-prev-word
bindkey -M emacs "^[ " expand-history
bindkey -M emacs "^[!" expand-history
bindkey -M emacs "^[\"" quote-region
bindkey -M emacs "^[\$" spell-word
bindkey -M emacs "^['" quote-line
bindkey -M emacs "^[-" neg-argument
bindkey -M emacs "^[." insert-last-word
bindkey -M emacs "^[0" digit-argument
bindkey -M emacs "^[1" digit-argument
bindkey -M emacs "^[2" digit-argument
bindkey -M emacs "^[3" digit-argument
bindkey -M emacs "^[4" digit-argument
bindkey -M emacs "^[5" digit-argument
bindkey -M emacs "^[6" digit-argument
bindkey -M emacs "^[7" digit-argument
bindkey -M emacs "^[8" digit-argument
bindkey -M emacs "^[9" digit-argument
bindkey -M emacs "^[<" beginning-of-buffer-or-history
bindkey -M emacs "^[>" end-of-buffer-or-history
bindkey -M emacs "^[?" which-command
bindkey -M emacs "^[A" accept-and-hold
bindkey -M emacs "^[B" backward-word
bindkey -M emacs "^[C" capitalize-word
bindkey -M emacs "^[D" kill-word
bindkey -M emacs "^[F" forward-word
bindkey -M emacs "^[G" get-line
bindkey -M emacs "^[H" run-help
bindkey -M emacs "^[L" down-case-word
bindkey -M emacs "^[N" history-search-forward
bindkey -M emacs "^[OA" up-line-or-history
bindkey -M emacs "^[OB" down-line-or-history
bindkey -M emacs "^[OC" forward-char
bindkey -M emacs "^[OD" backward-char
bindkey -M emacs "^[P" history-search-backward
bindkey -M emacs "^[Q" push-line
bindkey -M emacs "^[S" spell-word
bindkey -M emacs "^[T" transpose-words
bindkey -M emacs "^[U" up-case-word
bindkey -M emacs "^[W" copy-region-as-kill
bindkey -M emacs "^[[A" up-line-or-history
bindkey -M emacs "^[[B" down-line-or-history
bindkey -M emacs "^[[C" forward-char
bindkey -M emacs "^[[D" backward-char
bindkey -M emacs "^[_" insert-last-word
bindkey -M emacs "^[a" accept-and-hold
bindkey -M emacs "^[b" backward-word
bindkey -M emacs "^[c" capitalize-word
bindkey -M emacs "^[d" kill-word
bindkey -M emacs "^[f" forward-word
bindkey -M emacs "^[g" get-line
bindkey -M emacs "^[h" run-help
bindkey -M emacs "^[l" down-case-word
bindkey -M emacs "^[n" history-search-forward
bindkey -M emacs "^[p" history-search-backward
bindkey -M emacs "^[q" push-line
bindkey -M emacs "^[s" spell-word
bindkey -M emacs "^[t" transpose-words
bindkey -M emacs "^[u" up-case-word
bindkey -M emacs "^[w" copy-region-as-kill
bindkey -M emacs "^[x" execute-named-cmd
bindkey -M emacs "^[y" yank-pop
bindkey -M emacs "^[z" execute-last-named-cmd
bindkey -M emacs "^[|" vi-goto-column
bindkey -M emacs "^[^?" backward-kill-word
bindkey -M emacs "^_" undo
bindkey -R -M emacs " "-"~" self-insert
bindkey -M emacs "^?" backward-delete-char
bindkey -R -M emacs "\M-^@"-"\M-^?" self-insert

bindkey -R "^A"-"^C" self-insert
bindkey "^D" list-choices
bindkey -R "^E"-"^F" self-insert
bindkey "^G" list-expand
bindkey "^H" vi-backward-delete-char
bindkey "^I" expand-or-complete
bindkey "^J" accept-line
bindkey "^K" self-insert
bindkey "^L" clear-screen
bindkey "^M" accept-line
bindkey -R "^N"-"^P" self-insert
bindkey "^Q" vi-quoted-insert
bindkey "^R" redisplay
bindkey -R "^S"-"^T" self-insert
bindkey "^U" vi-kill-line
bindkey "^V" vi-quoted-insert
bindkey "^W" vi-backward-kill-word
bindkey -R "^X"-"^Z" self-insert
bindkey "^[" vi-cmd-mode
bindkey -R "^\\\\"-"~" self-insert
bindkey "^?" vi-backward-delete-char
bindkey -R "\M-^@"-"\M-^?" self-insert

bindkey -a "^D" list-choices
bindkey -a "^G" list-expand
bindkey -a "^H" vi-backward-char
bindkey -a "^J" accept-line
bindkey -a "^L" clear-screen
bindkey -a "^M" accept-line
bindkey -a "^N" down-history
bindkey -a "^P" up-history
bindkey -a "^R" redisplay
bindkey -a "^[OA" up-line-or-history
bindkey -a "^[OB" down-line-or-history
bindkey -a "^[OC" vi-forward-char
bindkey -a "^[OD" vi-backward-char
bindkey -a "^[[A" up-line-or-history
bindkey -a "^[[B" down-line-or-history
bindkey -a "^[[C" vi-forward-char
bindkey -a "^[[D" vi-backward-char
bindkey -a " " vi-forward-char
bindkey -a "\"" vi-set-buffer
bindkey -a "#" pound-insert
bindkey -a "\$" vi-end-of-line
bindkey -a "%" vi-match-bracket
bindkey -a "'" vi-goto-mark-line
bindkey -a "+" vi-down-line-or-history
bindkey -a "," vi-rev-repeat-find
bindkey -a -- "-" vi-up-line-or-history
bindkey -a "." vi-repeat-change
bindkey -a "/" vi-history-search-backward
bindkey -a "0" vi-digit-or-beginning-of-line
bindkey -R -a "1"-"9" digit-argument
bindkey -a ";" vi-repeat-find
bindkey -a "<" vi-unindent
bindkey -a "=" list-choices
bindkey -a ">" vi-indent
bindkey -a "?" vi-history-search-forward
bindkey -a "A" vi-add-eol
bindkey -a "B" vi-backward-blank-word
bindkey -a "C" vi-change-eol
bindkey -a "D" vi-kill-eol
bindkey -a "E" vi-forward-blank-word-end
bindkey -a "F" vi-find-prev-char
bindkey -a "G" vi-fetch-history
bindkey -a "I" vi-insert-bol
bindkey -a "J" vi-join
bindkey -a "N" vi-rev-repeat-search
bindkey -a "O" vi-open-line-above
bindkey -a "P" vi-put-before
bindkey -a "R" vi-replace
bindkey -a "S" vi-change-whole-line
bindkey -a "T" vi-find-prev-char-skip
bindkey -a "W" vi-forward-blank-word
bindkey -a "X" vi-backward-delete-char
bindkey -a "Y" vi-yank-whole-line
bindkey -a "\^" vi-first-non-blank
bindkey -a "\`" vi-goto-mark
bindkey -a "a" vi-add-next
bindkey -a "b" vi-backward-word
bindkey -a "c" vi-change
bindkey -a "d" vi-delete
bindkey -a "e" vi-forward-word-end
bindkey -a "f" vi-find-next-char
bindkey -a "h" vi-backward-char
bindkey -a "i" vi-insert
bindkey -a "j" down-line-or-history
bindkey -a "k" up-line-or-history
bindkey -a "l" vi-forward-char
bindkey -a "m" vi-set-mark
bindkey -a "n" vi-repeat-search
bindkey -a "o" vi-open-line-below
bindkey -a "p" vi-put-after
bindkey -a "r" vi-replace-chars
bindkey -a "s" vi-substitute
bindkey -a "t" vi-find-next-char-skip
bindkey -a "u" vi-undo-change
bindkey -a "w" vi-forward-word
bindkey -a "x" vi-delete-char
bindkey -a "y" vi-yank
bindkey -a "|" vi-goto-column
bindkey -a "~" vi-swap-case
bindkey -a "^?" vi-backward-char

bindkey -R -M viins "^A"-"^C" self-insert
bindkey -M viins "^D" list-choices
bindkey -R -M viins "^E"-"^F" self-insert
bindkey -M viins "^G" list-expand
bindkey -M viins "^H" vi-backward-delete-char
bindkey -M viins "^I" expand-or-complete
bindkey -M viins "^J" accept-line
bindkey -M viins "^K" self-insert
bindkey -M viins "^L" clear-screen
bindkey -M viins "^M" accept-line
bindkey -R -M viins "^N"-"^P" self-insert
bindkey -M viins "^Q" vi-quoted-insert
bindkey -M viins "^R" redisplay
bindkey -R -M viins "^S"-"^T" self-insert
bindkey -M viins "^U" vi-kill-line
bindkey -M viins "^V" vi-quoted-insert
bindkey -M viins "^W" vi-backward-kill-word
bindkey -R -M viins "^X"-"^Z" self-insert
bindkey -M viins "^[" vi-cmd-mode
bindkey -R -M viins "^\\\\"-"~" self-insert
bindkey -M viins "^?" vi-backward-delete-char
bindkey -R -M viins "\M-^@"-"\M-^?" self-insert

# Completions.

compctl -C -c -tn
compctl -D -f -tn
compctl -T

# Undefined functions.


# Defined functions.


# Limits.

limit datasize        1968MB
limit stacksize       79MB
limit coredumpsize    2047MB
limit descriptors     2048
limit cachedthreads   64

# Modules.

zmodload -d zsh/complete zsh/zle
zmodload -d zsh/compctl zsh/complete zsh/zle
zmodload -d zsh/complist zsh/complete zsh/zle
zmodload -d zsh/zutil zsh/complete
zmodload -d zsh/computil zsh/complete zsh/zle
zmodload -d zsh/zleparameter zsh/zle
zmodload -d compctl zsh/compctl
zmodload -d complete zsh/complete
zmodload -d complist zsh/complist
zmodload -d computil zsh/computil
zmodload -d parameter zsh/parameter
zmodload -d rlimits zsh/rlimits
zmodload -d sched zsh/sched
zmodload -d zle zsh/zle
zmodload -d zleparameter zsh/zleparameter
zmodload -d zutil zsh/zutil

zmodload -ab zsh/sched sched
zmodload -ab zsh/zutil zparseopts
zmodload -ab zsh/computil comptags
zmodload -ab zsh/computil compdescribe
zmodload -ab zsh/zutil zregexparse
zmodload -ab zsh/computil comparguments
zmodload -ab zsh/zutil zstyle
zmodload -ab zsh/computil comptry
zmodload -ab zsh/computil compvalues
zmodload -ab zsh/computil compquote
zmodload -ab zsh/zutil zformat


zmodload -ap zsh/parameter aliases
zmodload -ap zsh/parameter builtins
zmodload -ap zsh/parameter commands
zmodload -ap zsh/parameter dirstack
zmodload -ap zsh/parameter dis_aliases
zmodload -ap zsh/parameter dis_builtins
zmodload -ap zsh/parameter dis_functions
zmodload -ap zsh/parameter dis_galiases
zmodload -ap zsh/parameter dis_reswords
zmodload -ap zsh/parameter funcstack
zmodload -ap zsh/parameter functions
zmodload -ap zsh/parameter galiases
zmodload -ap zsh/parameter history
zmodload -ap zsh/parameter historywords
zmodload -ap zsh/parameter jobdirs
zmodload -ap zsh/parameter jobstates
zmodload -ap zsh/parameter jobtexts
zmodload -ap zsh/zleparameter keymaps
zmodload -ap zsh/parameter modules
zmodload -ap zsh/parameter nameddirs
zmodload -ap zsh/parameter options
zmodload -ap zsh/parameter parameters
zmodload -ap zsh/parameter reswords
zmodload -ap zsh/parameter userdirs
zmodload -ap zsh/zleparameter widgets

zmodload zsh/complete
zmodload zsh/compctl
zmodload zsh/main
zmodload zsh/zle
zmodload zsh/rlimits

# Non-array variables.

ARGC=0
AWK='awk'
BAUD='0'
CDPATH=''
COLUMNS='80'
CPP='/lib/cpp'
CPUTYPE='9000/785'
EDITOR='vi'
EGID='20'
ENV_RUN_DATE='200106'
ERASE='^H'
ERRNO='3'
EUID='101'
FCEDIT='vi'
FIGNORE=''
FPATH='/usr/share/zsh/site-functions:/usr/share/zsh/3.1.9/functions'
GID='20'
HISTCHARS='!^#'
HISTSIZE='30'
HOME='/home/dummy'
HOST='hpesande.fc.hp.com'
IFS=' 	
'
KEYTIMEOUT='40'
LINENO='360'
LINES='40'
LISTMAX='100'
LOGCHECK='60'
LOGNAME='dummy'
MACHTYPE='hppa2.0'
MAIL='/var/mail/dummy'
MAILCHECK='60'
MAILPATH=''
MANPATH='/opt/perl5/man:/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/usr/local/man/%L:/usr/local/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/ignite/share/man/%L:/opt/ignite/share/man:/opt/hparray/share/man/%L:/opt/hparray/share/man:/opt/prm/man/%L:/opt/prm/man:/opt/resmon/share/man:/opt/ansic/share/man/%L:/opt/ansic/share/man:/opt/langtools/share/man/%L:/opt/langtools/share/man:/opt/aCC/share/man/%L:/opt/aCC/share/man:/opt/imake/man:/opt/graphics/starbase/share/man:/opt/socks/man:/opt/softbench/man:/opt/softbench/share/man:/opt/medusa/share/man:/opt/pwplus/share/man'
MODULE_PATH='/usr/lib/zsh/3.1.9'
NULLCMD='cat'
OLDPWD='/home/ande/src/rpms/BUILD/zsh-4.0.1/Util'
OPTARG=''
OPTIND='1'
OSTYPE='hpux10.20'
PATH='/opt/perl5/bin:/usr/local/bin:/opt/softbench/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/opt/nettladm/bin:/opt/pd/bin:/opt/upgrade/bin:/opt/hparray/bin:/opt/prm/bin:/opt/resmon/bin:/opt/langtools/bin:/opt/aCC/bin:/opt/imake/bin:/opt/coe/acu/sbin:/opt/coe/bin:/opt/coe/ipm/sbin:/opt/coe/ipm/bin:/usr/contrib/bin:/opt/pwplus/bin:/usr/sbin'
POSTEDIT=''
PPID='11032'
PROMPT=''
PROMPT2=''
PROMPT3='?# '
PROMPT4='+%N:%i> '
PS1=''
PS2=''
PS3='?# '
PS4='+%N:%i> '
PSVAR=''
PWD='/home/ande/src/rpms/BUILD/zsh-4.0.1/Util'
RANDOM='26127'
READNULLCMD='more'
RPROMPT=''
RPS1=''
SECONDS='0'
SHELL='/bin/zsh'
SHLVL='2'
SPROMPT='zsh: correct '\''%R'\'' to '\''%r'\'' [nyae]? '
TERM='dtterm'
TIMEFMT='%J  %U user %S system %P cpu %*E total'
TMPPREFIX='/tmp/zsh'
TTY='/dev/pts/9'
TTYIDLE='-1'
TZ='MST7MDT'
UID='101'
USERNAME='dummy'
VENDOR='hp'
WATCH=''
WATCHFMT='%n has %a %l from %m.'
WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>'
ZSH_NAME='zsh'
ZSH_VERSION='4.0.1'
histchars='!^#'
prompt=''
status='0'
prompt='test%'

# Array variables.

argv=()
cdpath=('')
fignore=('')
fpath=('/usr/share/zsh/site-functions'
'/usr/share/zsh/3.1.9/functions')
mailpath=('')
manpath=('/opt/perl5/man' '/usr/share/man/%L' '/usr/share/man'
'/usr/contrib/man/%L' '/usr/contrib/man' '/usr/local/man/%L'
'/usr/local/man' '/opt/pd/share/man/%L' '/opt/pd/share/man'
'/opt/ignite/share/man/%L' '/opt/ignite/share/man'
'/opt/hparray/share/man/%L' '/opt/hparray/share/man'
'/opt/prm/man/%L' '/opt/prm/man' '/opt/resmon/share/man'
'/opt/ansic/share/man/%L' '/opt/ansic/share/man'
'/opt/langtools/share/man/%L' '/opt/langtools/share/man'
'/opt/aCC/share/man/%L' '/opt/aCC/share/man' '/opt/imake/man'
'/opt/graphics/starbase/share/man' '/opt/socks/man'
'/opt/softbench/man' '/opt/softbench/share/man'
'/opt/medusa/share/man' '/opt/pwplus/share/man')
module_path=('/usr/lib/zsh/3.1.9')
path=('/opt/perl5/bin' '/usr/local/bin' '/opt/softbench/bin'
'/usr/bin' '/opt/ansic/bin' '/usr/ccs/bin' '/opt/nettladm/bin'
'/opt/pd/bin' '/opt/upgrade/bin' '/opt/hparray/bin'
'/opt/prm/bin' '/opt/resmon/bin' '/opt/langtools/bin'
'/opt/aCC/bin' '/opt/imake/bin' '/opt/coe/acu/sbin'
'/opt/coe/bin' '/opt/coe/ipm/sbin' '/opt/coe/ipm/bin'
'/usr/contrib/bin' '/opt/pwplus/bin' '/usr/sbin')
pipestatus=('0')
psvar=('')
signals=('EXIT' 'HUP' 'INT' 'QUIT' 'ILL' 'TRAP' 'ABRT' 'EMT'
'FPE' 'KILL' 'BUS' 'SEGV' 'SYS' 'PIPE' 'ALRM' 'TERM' 'USR1'
'USR2' 'CHLD' 'PWR' 'VTALRM' 'PROF' 'IO' 'WINCH' 'STOP' 'TSTP'
'CONT' 'TTIN' 'TTOU' 'URG' 'LOST' 'RESERVE' 'DIL' 'XCPU' 'XFSZ'
'ZERR' 'DEBUG')
watch=('')

# Exported variables.

export COLUMNS
export EDITOR
export ENV_RUN_DATE
export ERASE
export HOME
export LINES
export LOGNAME
export MAIL
export MANPATH
export OLDPWD
export PATH
export PWD
export SHELL
export SHLVL
export TERM
export TZ

# Setopt.


# Styles.


# END zsh saveset


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-04 18:30 Export problem a normal guy
@ 2001-06-04 18:42 ` Geoff Wing
  2001-06-05  5:18   ` Andrej Borsenkow
  0 siblings, 1 reply; 16+ messages in thread
From: Geoff Wing @ 2001-06-04 18:42 UTC (permalink / raw)
  To: a normal guy; +Cc: Zsh Hackers

a normal guy wrote about Export problem:
:I think this is a bug.  Under HP-UX, the following line reports
:an error:
:% export RUN_DATE=`date +%Y%m%e%H%M.%S`
:zsh: not an identifier: 41211.52

Or maybe you want:
% export RUN_DATE="`date +%Y%m%e%H%M.%S`"

so that the space provided by %e doesn't cause word splitting.

Regards,
-- 
Geoff Wing : <gcw@pobox.com>
Rxvt Stuff : <gcw@rxvt.org>
Zsh Stuff  : <gcw@zsh.org>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: Export problem
  2001-06-04 18:42 ` Geoff Wing
@ 2001-06-05  5:18   ` Andrej Borsenkow
  2001-06-05  9:35     ` Peter Stephenson
  2001-06-05  9:39     ` Peter Stephenson
  0 siblings, 2 replies; 16+ messages in thread
From: Andrej Borsenkow @ 2001-06-05  5:18 UTC (permalink / raw)
  To: Geoff Wing, a normal guy; +Cc: Zsh Hackers

>
> a normal guy wrote about Export problem:
> :I think this is a bug.  Under HP-UX, the following line reports
> :an error:
> :% export RUN_DATE=`date +%Y%m%e%H%M.%S`
> :zsh: not an identifier: 41211.52
>
> Or maybe you want:
> % export RUN_DATE="`date +%Y%m%e%H%M.%S`"
>
> so that the space provided by %e doesn't cause word splitting.
>

This is a bug. No field splitting should be done in parameter assignment
context. Look is SUS for more detail; in short:

- Word expansions:
. Tilde Expansion . Parameter Expansion . Command Substitution . Arithmetic
Expansion . Field Splitting . Pathname Expansion . Quote Removal

- command line porcessing rules:

1. The words that are recognised as variable assignments or redirections
according to Shell Grammar Rules are saved for processing in steps 3 and 4.

2. The words that are not variable assignments or redirections will be
expanded. If any fields remain following their expansion, the first field
will be considered the command name and remaining fields will be the
arguments for the command.

3. Redirections will be performed as described in Redirection .

4. Each variable assignment will be expanded for tilde expansion, parameter
expansion, command substitution, arithmetic expansion and quote removal
prior to assigning the value.

Please note paragraph 4. It explicitly omits Field Splitting from expansions
done for parameter assignments and redirections.

-andrej



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-05  5:18   ` Andrej Borsenkow
@ 2001-06-05  9:35     ` Peter Stephenson
  2001-06-06  7:51       ` Clint Adams
  2001-06-06  8:27       ` Andrej Borsenkow
  2001-06-05  9:39     ` Peter Stephenson
  1 sibling, 2 replies; 16+ messages in thread
From: Peter Stephenson @ 2001-06-05  9:35 UTC (permalink / raw)
  To: Zsh hackers list

"Andrej Borsenkow" wrote:
> > :% export RUN_DATE=`date +%Y%m%e%H%M.%S`
> > :zsh: not an identifier: 41211.52
> 
> This is a bug. No field splitting should be done in parameter assignment
> context. Look is SUS for more detail; in short:
> 
> 3. Redirections will be performed as described in Redirection .
> 
> 4. Each variable assignment will be expanded for tilde expansion, parameter
> expansion, command substitution, arithmetic expansion and quote removal
> prior to assigning the value.
> 
> Please note paragraph 4. It explicitly omits Field Splitting from expansions
> done for parameter assignments and redirections.

It's a bit ambiguous, it does say `command substitution' which always
implies word-splitting of unquoted words.  But you can take the reference
to `variable assignment' at the start to imply the result remains part of
the variable assignment.  And the question for us is really what POSIX
says.

We already check specially for tildes, I dare say this can be done, but
even so it's a rather confusing special case.  If we did this, I'd be
strongly inclined to upgrade MAGIC_EQUAL_SUBST along the same lines, so
that with the option set
  make MAKE_VARIABLE=`command subst`
had the same property.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-05  5:18   ` Andrej Borsenkow
  2001-06-05  9:35     ` Peter Stephenson
@ 2001-06-05  9:39     ` Peter Stephenson
  2001-06-05 10:16       ` Andrej Borsenkow
  1 sibling, 1 reply; 16+ messages in thread
From: Peter Stephenson @ 2001-06-05  9:39 UTC (permalink / raw)
  To: Zsh hackers list

"Andrej Borsenkow" wrote:
> - command line porcessing rules:
> 
> 1. The words that are recognised as variable assignments or redirections
> according to Shell Grammar Rules are saved for processing in steps 3 and 4.

Actually, reading this again, is it clear that this means variable
assignments as arguments to typeset etc., and not raw variable assignments?
We already don't split on
  foo=`command subst` command
and that may be all it means.  But it may not.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: Export problem
  2001-06-05  9:39     ` Peter Stephenson
@ 2001-06-05 10:16       ` Andrej Borsenkow
  0 siblings, 0 replies; 16+ messages in thread
From: Andrej Borsenkow @ 2001-06-05 10:16 UTC (permalink / raw)
  To: Zsh hackers list

>
> Actually, reading this again, is it clear that this means variable
> assignments as arguments to typeset etc., and not raw variable
> assignments?
> We already don't split on
>   foo=`command subst` command
> and that may be all it means.  But it may not.
>

Sorry, I missed `export'. My fault. Of course the description applies to
plain assignment.

-andrej


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-05  9:35     ` Peter Stephenson
@ 2001-06-06  7:51       ` Clint Adams
  2001-06-06  8:18         ` Andrej Borsenkow
  2001-06-06  8:27       ` Andrej Borsenkow
  1 sibling, 1 reply; 16+ messages in thread
From: Clint Adams @ 2001-06-06  7:51 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list


> It's a bit ambiguous, it does say `command substitution' which always
> implies word-splitting of unquoted words.  But you can take the reference
> to `variable assignment' at the start to imply the result remains part of
> the variable assignment.  And the question for us is really what POSIX
> says.

It says that the shell is to do field splitting after parameter
expansion, command substitution, and arithmetic expansion,
provided double quotes are not involved.  More or less.

I'm not sure that that clears things up, since I interpret
the meaning of `word' in ${x:=word}, x=word, and export x=word
to be the pre-expanded word.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: Export problem
  2001-06-06  7:51       ` Clint Adams
@ 2001-06-06  8:18         ` Andrej Borsenkow
  2001-06-06 13:48           ` Clint Adams
  0 siblings, 1 reply; 16+ messages in thread
From: Andrej Borsenkow @ 2001-06-06  8:18 UTC (permalink / raw)
  To: Zsh hackers list


Oh God! I am awfully sorry for confusion I caused ...

>
> > It's a bit ambiguous, it does say `command substitution' which always
> > implies word-splitting of unquoted words.  But you can take the
> reference
> > to `variable assignment' at the start to imply the result
> remains part of
> > the variable assignment.  And the question for us is really what POSIX
> > says.
>
> It says that the shell is to do field splitting after parameter
> expansion, command substitution, and arithmetic expansion,
> provided double quotes are not involved.  More or less.
>

What do you mean "more or less"? Was 14716 unclear? "Variable assignment" is
strictly defined grammar construct. No more and no less. In

foo=bar bla bla bar=baz

foo=bar is variable assignment and bar=baz is command argument.

> I'm not sure that that clears things up, since I interpret
> the meaning of `word' in ${x:=word}, x=word, and export x=word
> to be the pre-expanded word.
>

I was under impression that we've already cleaned that up. Anyway, I do not
understand what "pre-expanded" word is. POSIX shell never mentions this so
it does not clears up anything. Speaking of the above:

- in ${x:=word} word is *never* splitted irrespectively of where it appears
and if it is quoted
- x=word is not splitted (should I add "never"?)
- in export x=word the whole `x=word' is field splitted unless quoted.

-andrej


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: Export problem
  2001-06-05  9:35     ` Peter Stephenson
  2001-06-06  7:51       ` Clint Adams
@ 2001-06-06  8:27       ` Andrej Borsenkow
  1 sibling, 0 replies; 16+ messages in thread
From: Andrej Borsenkow @ 2001-06-06  8:27 UTC (permalink / raw)
  To: Zsh hackers list


>
> It's a bit ambiguous, it does say `command substitution' which always
> implies word-splitting of unquoted words.

Please, please! Do not confuse things even more :-) "Field splitting" is
well defined operation applied in well defined cases alongside of "command
substitution". Command substitution does not imply field splitting. At least
in POSIX shell.

-andrej



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-06  8:18         ` Andrej Borsenkow
@ 2001-06-06 13:48           ` Clint Adams
  2001-06-06 14:41             ` Andrej Borsenkow
  0 siblings, 1 reply; 16+ messages in thread
From: Clint Adams @ 2001-06-06 13:48 UTC (permalink / raw)
  To: Andrej Borsenkow; +Cc: Zsh hackers list


> What do you mean "more or less"? Was 14716 unclear? "Variable assignment" is

What I meant was that my paraphrasing of the spec could perhaps imply more
or less than would a verbatim quote.

> strictly defined grammar construct. No more and no less. In
> 
> foo=bar bla bla bar=baz
> 
> foo=bar is variable assignment and bar=baz is command argument.

I don't dispute that.

> - in ${x:=word} word is *never* splitted irrespectively of where it appears
> and if it is quoted

Where is that stated?

> - x=word is not splitted (should I add "never"?)

Where is that stated?
Your quote of SUS (which is lifted from POSIX) said
that each variable assignment undergoes expansion
in step 4, including parameter expansion and command
substitution.  In addition, the bit about Field Splitting
says that "the shell shall scan the results of expansions
and substitutions that did not occur in double-quotes
for field splitting and multiple fields can result."
It then goes on to talk about IFS and how splitting
is to occur.  I also don't see any exceptions or
proscriptions against splitting when variable assignment
is involved.

> - in export x=word the whole `x=word' is field splitted unless quoted.

That seems fairly straight-forward, but I don't understand the
intended effect.  The output of field splitting is "fields."
The input is whatever results from the expansion or substitution
of "words."  Does POSIX define these things?

If `date +%z%f` expanded to "-0400; rm -rf .", what should

export THIS=`date +%z%f` do?

a) export THIS with the value "-0400; rm -rf ."
b) export THIS with the value "-0400; rm -rf ." as an array of 4 words?
   POSIX doesn't seem to acknowledge the concept of arrays in the Shell
   Command Language.
c) export THIS with the value "-0400;" and try to export parameters
   named "rm", "-rf", and "."?
d) retokenize the line and treat it as a sequential list of two commands?


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: Export problem
  2001-06-06 13:48           ` Clint Adams
@ 2001-06-06 14:41             ` Andrej Borsenkow
  2001-06-06 15:23               ` Clint Adams
  0 siblings, 1 reply; 16+ messages in thread
From: Andrej Borsenkow @ 2001-06-06 14:41 UTC (permalink / raw)
  To: Zsh hackers list


>
> > - in ${x:=word} word is *never* splitted irrespectively of
> where it appears
> > and if it is quoted
>
> Where is that stated?
>

Nowhere. You misunderstand the basic concept of field splitting in sh. I
suspect, it is a result of incorrect implementation of splitting in zsh.

Field Splitting is the step in processing of command line. It happens
*after* parameter substitution. It means, that ``word'' in ${x:=word} is
never splitted - the *result* of this substitution as a whole may possibly
be splitted.

> > - x=word is not splitted (should I add "never"?)
>
> Where is that stated?
> Your quote of SUS (which is lifted from POSIX) said
> that each variable assignment undergoes expansion
> in step 4, including parameter expansion and command
> substitution.  In addition, the bit about Field Splitting
> says that "the shell shall scan the results of expansions
> and substitutions that did not occur in double-quotes
> for field splitting and multiple fields can result."
> It then goes on to talk about IFS and how splitting
> is to occur.  I also don't see any exceptions or
> proscriptions against splitting when variable assignment
> is involved.
>

It does not say "the shell scans the result of *every* expansion ...".
Please, understand - splitting in sh does not happen as part of
variable/command substitution. It happens after these substitutions have
been done. The above simply means that in ``IFS=:; ls a:b${foo}'' the a:b
will *not* be splitted even though IFS is set to ``:''. But ${foo} possibly
will. That is also correctly implemeted by zsh and bash.

> > - in export x=word the whole `x=word' is field splitted unless quoted.
>
> That seems fairly straight-forward, but I don't understand the
> intended effect.  The output of field splitting is "fields."
> The input is whatever results from the expansion or substitution
> of "words."  Does POSIX define these things?
>

Yes. Please, look in grammar for definition of WORD, look here
<http://www.opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_006>
for precise definition how expansions are performed and look in my previous
mail for definition how fields are used (first field becomes command name,
subsequent fields become arguments).

> If `date +%z%f` expanded to "-0400; rm -rf .", what should
>
> export THIS=`date +%z%f` do?
>
> a) export THIS with the value "-0400; rm -rf ."
> b) export THIS with the value "-0400; rm -rf ." as an array of 4 words?
>    POSIX doesn't seem to acknowledge the concept of arrays in the Shell
>    Command Language.
> c) export THIS with the value "-0400;" and try to export parameters
>    named "rm", "-rf", and "."?

One answer for all - it should execute command ``export'' with parameters:

THIS=-0400;
rm
-rf
.

What the command ``export'' does with these parameters - it is up to this
command.

> d) retokenize the line and treat it as a sequential list of two commands?
>

Oh, no! Please :-)

-andrej


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-06 14:41             ` Andrej Borsenkow
@ 2001-06-06 15:23               ` Clint Adams
  0 siblings, 0 replies; 16+ messages in thread
From: Clint Adams @ 2001-06-06 15:23 UTC (permalink / raw)
  To: Andrej Borsenkow; +Cc: Zsh hackers list


> Yes. Please, look in grammar for definition of WORD, look here
> <http://www.opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_006>
> for precise definition how expansions are performed and look in my previous
> mail for definition how fields are used (first field becomes command name,
> subsequent fields become arguments).

field

       In the shell, a unit of text that is the result of parameter
       expansion (see the XCU specification, Parameter Expansion ),
       arithmetic expansion (see the XCU specification, Arithmetic
       Expansion ), command substitution (see the XCU specification,
       Command Substitution ), or field splitting (see the XCU
       specification, Field Splitting ). During command processing
       (see the XCU specification, Simple Commands ), the resulting
       fields are used as the command name and its arguments. 

word

       In the shell, a token other than an operator. In some cases a
       word is also a portion of a word token: in the various forms of
       parameter expansion (see the XCU specification, Parameter Expansion ),
       such as ${name-word}, and variable assignment, such as name=word, the
       word is the portion of the token depicted by word. The concept of a
       word is no longer applicable following word expansions only fields remain;
       see the XCU specification, Word Expansions . 

> One answer for all - it should execute command ``export'' with parameters:
> 
> THIS=-0400;
> rm
> -rf
> .
> 
> What the command ``export'' does with these parameters - it is up to this
> command.

I think I've got it now.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-11 18:24 HP-UX 11.00 tgetenv dilemma Andrej Borsenkow
@ 2001-06-11 22:05 ` a normal guy
  0 siblings, 0 replies; 16+ messages in thread
From: a normal guy @ 2001-06-11 22:05 UTC (permalink / raw)
  To: Andrej Borsenkow; +Cc: ZSH Workers Mailing List

--- Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> wrote:
>> 
>> P.S.  What is the latest line of thought about the Export
word
>> splitting problem?  To fix or not to fix?
>> 
> 
> 
> It is not bug - it complies with standards. Granted, there are
> 
> compatibility issues (both ksh and bash behave the way you
> desire), but so far you are the first person to note it :-)
> That does not mean I am opposed to "fixing" it - I just have
> no idea how easy (or difficult) it is.
> 
> -andrej
> 

I appreciate you considering this for a fix (if possible). 
Thank you for pointing out that it is not a bug per the
standard.  As for compatibility, I work in a lab that mixes the
use of ksh88, sh-posix, bash, and zsh.  The line that found this
incompatibility is an environment setup script, and I'll attempt
to the line to conform to the SUS.  Zsh is an awesome shell and
I appreciate all the efforts made to by you guys.

Scott

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
  2001-06-06  5:56   ` Andrej Borsenkow
@ 2001-06-06 10:06     ` Bart Schaefer
  0 siblings, 0 replies; 16+ messages in thread
From: Bart Schaefer @ 2001-06-06 10:06 UTC (permalink / raw)
  To: Zsh Hackers

On Jun 6,  9:56am, Andrej Borsenkow wrote:
} Subject: RE: Export problem
}
} 2. Both bash and ksh88 (version that I have) do not split export arguments.
} That calls for compatibility option.
} 
} I am not sure how to call it. May be it is time to start POSIX_* set of
} options. POSIX_EXPORT_SPLIT?

Hrm; POSIX_EXPORT_SPLIT would be *on* by default, then, as bash/ksh do
not split.  And it's not just `export', it's also `typeset' etc.  Maybe
KSH_TYPESET would be a better option name, and we could also check it
to see whether we should force compatibility with ksh's `typeset' flag
letter meanings in case of collisions (same way ksh emulation changes
the interpretation of `set' single-letter-options).

Unless we're already incompatibile with POSIX typeset flag letters, or
unless we're worried about bash compatibility and bash has yet a third
set of options, in which case we've got a deeper hole to dig out of.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: Export problem
  2001-06-05 15:52 ` a normal guy
@ 2001-06-06  5:56   ` Andrej Borsenkow
  2001-06-06 10:06     ` Bart Schaefer
  0 siblings, 1 reply; 16+ messages in thread
From: Andrej Borsenkow @ 2001-06-06  5:56 UTC (permalink / raw)
  To: a normal guy, Zsh Hackers


>
>
> --- Bart Schaefer <schaefer@candle.brasslantern.com> wrote:
> > On Jun 5,  9:18am, Andrej Borsenkow wrote:
> > } Subject: RE: Export problem
> > }
> > } This is a bug. No field splitting should be done in
> > parameter assignment
> > } context.
> >
> > The arguments of the `export' command are not a parameter
> > assignment context,
> > or at least zsh has never treated them as such.  If you want
> > parameter
> > assignment context, you have to do two separate commands:
> >
> >     RUN_DATE=`date +%Y%m%e%H%M.%S`
> >     export RUN_DATE
> >
> > This does not do field splitting.
> >
> > If the SUS says elsewhere that the arguments of `export' (and
> > `typeset' et al.) are to be parsed as parameter assignments,
> > we're going to have to change `export' (etc.) from command
> > names to keywords.
>
> As for compatibility with other shells (POSIX, Korn shell,
> BASH), this would need to be addressed.  An option setting would
> do if necessary.
>

To clarify:

1. I was wrong initially (missed export). SUS never says that export is to
be treated differently from any other command. So there is no question about
POSIX compatibility (zsh is already POSIX-compatible)

2. Both bash and ksh88 (version that I have) do not split export arguments.
That calls for compatibility option.

I am not sure how to call it. May be it is time to start POSIX_* set of
options. POSIX_EXPORT_SPLIT?

-andrej


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Export problem
       [not found] <1010605064402.ZM4270@candle.brasslantern.com>
@ 2001-06-05 15:52 ` a normal guy
  2001-06-06  5:56   ` Andrej Borsenkow
  0 siblings, 1 reply; 16+ messages in thread
From: a normal guy @ 2001-06-05 15:52 UTC (permalink / raw)
  To: Zsh Hackers

--- Bart Schaefer <schaefer@candle.brasslantern.com> wrote:
> On Jun 5,  9:18am, Andrej Borsenkow wrote:
> } Subject: RE: Export problem
> }
> } This is a bug. No field splitting should be done in
> parameter assignment
> } context.
> 
> The arguments of the `export' command are not a parameter
> assignment context,
> or at least zsh has never treated them as such.  If you want
> parameter
> assignment context, you have to do two separate commands:
> 
>     RUN_DATE=`date +%Y%m%e%H%M.%S`
>     export RUN_DATE
> 
> This does not do field splitting.
> 
> If the SUS says elsewhere that the arguments of `export' (and
> `typeset' et al.) are to be parsed as parameter assignments,
> we're going to have to change `export' (etc.) from command
> names to keywords.

As for compatibility with other shells (POSIX, Korn shell,
BASH), this would need to be addressed.  An option setting would
do if necessary.

Scott



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2001-06-11 22:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-04 18:30 Export problem a normal guy
2001-06-04 18:42 ` Geoff Wing
2001-06-05  5:18   ` Andrej Borsenkow
2001-06-05  9:35     ` Peter Stephenson
2001-06-06  7:51       ` Clint Adams
2001-06-06  8:18         ` Andrej Borsenkow
2001-06-06 13:48           ` Clint Adams
2001-06-06 14:41             ` Andrej Borsenkow
2001-06-06 15:23               ` Clint Adams
2001-06-06  8:27       ` Andrej Borsenkow
2001-06-05  9:39     ` Peter Stephenson
2001-06-05 10:16       ` Andrej Borsenkow
     [not found] <1010605064402.ZM4270@candle.brasslantern.com>
2001-06-05 15:52 ` a normal guy
2001-06-06  5:56   ` Andrej Borsenkow
2001-06-06 10:06     ` Bart Schaefer
2001-06-11 18:24 HP-UX 11.00 tgetenv dilemma Andrej Borsenkow
2001-06-11 22:05 ` Export problem a normal guy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).