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

Re: path PATH




For purposes of cleaning up dead variables I sometimes want to list any unset params.  Before recent education I thought:

$ set | grep -E "bg$"

bg

... meant that bg was unset and now I know it's hidden.  (Nice if that was made more explicit.) So what would be a complete list of unset params?  This is close:

$ typeset -mp "*" | grep -e "=(  )$" -e "=''$" -e "=0$"

typeset ZLE_LINE_ABORTED=''
typeset -aT CDPATH cdpath=(  )
typeset -T CDPATH cdpath=(  )
typeset -aT MAILPATH mailpath=(  )
typeset -aT MANPATH manpath=(  )
typeset -T MANPATH manpath=(  )
typeset -a compprefuncs=(  )
typeset -aT WATCH watch=(  )
typeset cc=0
typeset -a zzz=(  )
typeset OPTARG=''
typeset -i10 UID=0
typeset KEYBOARD_HACK=''
typeset -i10 GID=0
typeset zz=''
typeset -aT FIGNORE fignore=(  )
typeset -T WATCH watch=(  )
typeset MATCH_FOUND=''
typeset -T MAILPATH mailpath=(  )
typeset -i zzzz=0
typeset -a comppostfuncs=(  )
typeset -T FIGNORE fignore=(  )
typeset _execute_input=''
typeset _execute_history=''
typeset -aT PSVAR psvar=(  )
typeset _execute_output=''
typeset -a z=(  )
typeset -a argv=(  )
typeset _execute_linecount=''
typeset varis_switches=''
typeset -T PSVAR psvar=(  )
typeset -i10 EUID=0
typeset -i10 EGID=0

... but probably there's others.

BTW, I very much doubt anything can be done about it, but I trust there's no way to distinguish between an unset integer and one explicitly set to zero?  Not that much will ever hinge on it.






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