[patch] shell/ash.c: mimics dash WRT 'set [+|-]o'

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sun May 4 05:23:55 PDT 2008


It also replicates reality in some error messages, like:

  # ./busybox ash -c 'set -q'
  ash: set: line 1: illegal option -q

  # ./busybox ash -c 'set +q'
  ash: set: line 1: illegal option +q

Currently shows always '-q' regardless.

Current behaviour (same output for -o as for +o):

  # ./busybox ash -c "set -o"
  Current option settings
  errexit         off
  noglob          off
  ignoreeof       off
  interactive     off
  monitor         off
  noexec          off
  stdin           off
  xtrace          off
  verbose         off
  noclobber       off
  allexport       off
  notify          off
  nounset         off
  vi              off

  # ./busybox ash -c "set +o"
  Current option settings
  errexit         off
  noglob          off
  ignoreeof       off
  interactive     off
  monitor         off
  noexec          off
  stdin           off
  xtrace          off
  verbose         off
  noclobber       off
  allexport       off
  notify          off
  nounset         off
  vi              off

The attached patch makes ash produce this:

  # ./busybox ash -c 'set -fmb;set -o'
  errexit         off
  noglob          on
  ignoreeof       off
  interactive     off
  monitor         on
  noexec          off
  stdin           off
  xtrace          off
  verbose         off
  noclobber       off
  allexport       off
  notify          on
  nounset         off
  vi              off

  # ./busybox ash -c 'set -fmb;set +o'
  set +o errexit
  set -o noglob
  set +o ignoreeof
  set +o interactive
  set -o monitor
  set +o noexec
  set +o stdin
  set +o xtrace
  set +o verbose
  set +o noclobber
  set +o allexport
  set -o notify
  set +o nounset
  set +o vi

similar to both dash and bash.


Cheers,

-- 
Cristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ash.c.+o.5.patch
Type: text/x-diff
Size: 1430 bytes
Desc: 
Url : http://busybox.net/lists/busybox/attachments/20080504/8183bd84/attachment.patch 


More information about the busybox mailing list