aboutsummaryrefslogtreecommitdiff
path: root/bin/ksh/PROJECTS
blob: 0be0e85ac15049e37da6ebfaee5f448086105c47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
$OpenBSD: PROJECTS,v 1.8 2015/09/14 09:42:33 nicm Exp $

Things to be done in pdksh (see also the NOTES file):

    * builtin utilities:
      pdksh has most if not all POSIX/at&t ksh builtins, but they need to
      be checked that they conform to POSIX/at&t manual.  Part of the
      process is changing the builtins to use the ksh_getopt() routine.

      The following builtins, which are defined by POSIX, haven't been
      examined:
	eval

      The first pass has been done on the following commands:
	. : alias bg break cd continue echo exec exit export false fc fg
	getopts jobs kill pwd read readonly return set shift time trap true
	umask unalias unset wait

      The second pass (ie, believed to be completely POSIX) has been done on
      the following commands:
	test

      (ulimit also needs to be examined to check that it fits the posix style)

    * test suite
      Ideally, as the builtin utilities are being POSIXized, short tests
      should be written to be used in regression testing.  The tests
      directory contains some tests, but many more need to be written.

    * internationalization
      Need to handle with the LANG and LC_* environment variables.  This
      involves changes to ensure <ctype.h> macros are being used (currently
      uses its own macros in many places), figuring out how to deal with
      bases (for integer arithmetic, eg, 12#1A), and (the nasty one) doing
      string look ups for error messages, etc..  It probably isn't worth
      translating strings to other languages yet as the code is likely
      to change a lot in the near future, but it would be good to have the
      code set up so string tables can be used.

    * trap code
	* add the DEBUG trap.
	* fix up signal handling code.  In particular, fatal vs tty signals,
	  have signal routine to call to check for pending/fatal traps, etc.

    * parsing
	* the time keyword needs to be hacked to accept options (!) since
	  POSIX says it shall accept the -p option and must skip a -- argument
	  (end of options).  Yuck.

    * lexing
      the lexing may need a re-write since it currently doesn't parse $( .. ),
      $(( .. )), (( ... )) properly.
	* need to ignore contents of quoted strings (and escaped chars?)
	  inside $( .. ) and $(( .. )) when counting parentheses.
	* need to put bounds check on states[] array (if it still exists after
	  the re-write)

    * variables
	* The "struct tbl" that is currently used for variables needs work since
	  more information (eg, array stuff, fields) are needed for variables
	  but not for the other things that use "struct tbl".
	* Arrays need to be implemented differently: currently does a linear
	  search of a linked list to find element i; the linked list is not
	  freed when a variable is unset.

    * functions
      finish the differences between function x and x(): trap EXIT, traps
      in general, treatment of OPTIND/OPTARG,

    * history
      There are two versions of the history code, COMPLEX_HISTORY and
      EASY_HISTORY, which need to be merged.  COMPLEX does at&t style history
      where the history file is written after each command and checked when
      ever looking through the history (in case another shell has added
      something).  EASY simply reads the history file at startup and writes
      it before exiting.
	* re-write the COMPLEX_HISTORY code so mmap() not needed (currently
	  can't be used on machines without mmap()).
	* Add multiline knowledge to COMPLEX_HISTORY (see EASY_HISTORY
	  stuff).
	* change COMPLEX_HISTORY code so concurrent history files are
	  controlled by an option (set -o history-concurrent?).  Delete
	  the EASY_HISTORY code.
	* bring history code up to POSIX standards (see POSIX description
	  of fc, etc.).

    * documentation
      Some sort of tutorial with examples would be good.  Texinfo is probably
      the best medium for this.  Also, the man page could be converted to
      texinfo (if the tutorial and man page  are put in the same texinfo
      page, they should be somewhat distinct - i.e., the tutorial should
      be a separate thread - but there should be cross references between the
      two).

    * miscellaneous
	* POSIX specifies what happens when various kinds of errors occur
	  in special built-ins commands vs regular commands (builtin or
	  otherwise) (see POSIX.2:3.8.1).  Some of this has been taken
	  care of, but more needs doing.

	* remove static limits created by fixed sized arrays
	  (eg, ident[], heres[], PATH, buffer size in emacs/vi code)

	* merge the emacs and vi code (should reduce the size of the shell and
	  make maintenance easier); handle SIGWINCH while editing a line.
	  [John Rochester is working on the merge]

	* add POSIX globbing (eg, [[:alnum:]]), see POSIX.2:2.8.3.2.

	* teach shf_vfprintf() about long long's (%lld); also make %p use
	  long longs if appropriate.