# Enable this line to disable command line editing
#EDIT=-DNO_HISTORY
-# Enable this line to use the editline library instead of libedit
-EDIT=-DEDITLINE
# Enable this line if your system does not have a <paths.h>
#NO_PATHS_H=-DNO_PATHS_H
NO_JOBS=-DJOBS=0
MKB_NO_JOBS=-j
-SRCS= alias.c arith.y arith_lex.l cd.c eval.c exec.c expand.c \
+SRCS= alias.c arith.y arith_lex.l cd.c complete.c eval.c exec.c expand.c \
histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
mystring.c options.c output.c parser.c redir.c show.c \
trap.c var.c setmode.c
* Echo command.
*/
-#ifdef __minix
-#define MINIX
-#endif
-
#include "bltin.h"
-#ifndef MINIX
-/* #define eflag 1 */
-#else
-#undef eflag
-#endif
-
int
echocmd(argc, argv)
int argc;
char c;
int count;
int nflag = 0;
-#ifndef eflag
+#ifdef __minix
int eflag = 0;
#endif
if (argc)
ap++;
if ((p = *ap) != NULL) {
-#ifdef MINIX
+#ifdef __minix
if (equal(p, "--")) {
ap++;
}
nflag++;
ap++;
} else if (equal(p, "-e")) {
-#ifndef eflag
+#ifdef __minix
eflag++;
#endif
ap++;
bltincmd builtin
commandcmd command
-#alloccmd alloc
+#if JOBS
bgcmd -j bg
+#endif
breakcmd break continue
#catfcmd catf
cdcmd cd chdir
exprcmd expr test [
falsecmd false
histcmd -h fc
+#if JOBS
fgcmd -j fg
+#endif
getoptscmd getopts
hashcmd hash
jobidcmd jobid
jobscmd jobs
-#linecmd line
localcmd local
-#nlechocmd nlecho
+#ifndef SMALL
#printfcmd printf
+#endif
pwdcmd pwd
readcmd read
returncmd return
unaliascmd unalias
unsetcmd unset
waitcmd wait
-#foocmd foo
aliascmd alias
ulimitcmd ulimit
bindcmd bind
wordexpcmd wordexp
-
-#
-# $PchId: builtins.def,v 1.5 2006/03/31 10:50:57 philip Exp $
#include "error.h"
#include "show.h"
#include "mystring.h"
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
#include "myhistedit.h"
#endif
exitstatus = 0;
goto out;
}
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
displayhist = 1; /* show history substitutions done with fc */
#endif
TRACE(("evaltree(0x%lx: %d) called\n", (long)n, n->type));
int e;
execve(cmd, argv, envp);
-#if !__minix_vmd
+
e = errno;
if (e == ENOEXEC) {
initshellproc();
/*NOTREACHED*/
}
errno = e;
-#endif
}
/*
#include "output.h"
#include "mystring.h"
#include "builtins.h"
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
#include "myhistedit.h"
#include "complete.h"
#include "error.h"
if (hs == NULL || *hs == '\0' ||
(histsize = atoi(hs)) < 0)
histsize = 100;
- history(hist, &he, H_EVENT, histsize);
+ history(hist, &he, H_SETSIZE, histsize);
}
}
error("not compiled with line editing support");
return (0);
}
-#endif /* !NO_HISTORY && !EDITLINE */
+#endif /* !NO_HISTORY */
/*
* $PchId: histedit.c,v 1.6 2006/04/10 14:52:58 philip Exp $
#include "error.h"
#include "alias.h"
#include "parser.h"
-#ifdef EDITLINE
-#ifdef __minix_vmd
-#include <readline/readline.h>
-#else
-/* What about other systems? */
-char *readline(char *prompt);
-#endif
-#else
#include "myhistedit.h"
-#endif
#include "redir.h"
#include "trap.h"
int init_editline = 0; /* editline library initialized? */
int whichprompt; /* -1 == PSE, 1 == PS1, 2 == PS2 */
-#ifndef EDITLINE
EditLine *el; /* cookie for editline package */
-#endif
STATIC void pushfile(void);
static int preadfd(void);
int nr;
parsenextc = parsefile->buf;
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
if (el != NULL && gotwinch) {
gotwinch = 0;
el_resize(el);
#endif
retry:
#ifndef NO_HISTORY
-#ifdef EDITLINE
- if (parsefile->fd == 0 && editable) {
- static const char *rl_cp= NULL;
- static size_t rl_off= 0;
-
- if (!rl_cp)
- {
- rl_cp = readline(getprompt(NULL));
- if (rl_cp == NULL)
- nr = 0;
- }
- if (rl_cp)
- {
- nr= strlen(rl_cp+rl_off);
- if (nr >= BUFSIZ-1)
- {
- nr= BUFSIZ-1;
- (void) memcpy(parsenextc, rl_cp+rl_off, nr);
- rl_off += nr;
- }
- else
- {
- (void) memcpy(parsenextc, rl_cp+rl_off, nr);
- parsenextc[nr++]= '\n';
- free((void *)rl_cp);
- rl_cp= NULL;
- rl_off= 0;
- }
- }
- } else
-#else /* !EDITLINE */
if (parsefile->fd == 0 && el) {
const char *rl_cp;
(void) strcpy(parsenextc, rl_cp);
}
} else
-#endif /* !EDITLINE */
#endif
nr = read(parsefile->fd, parsenextc, BUFSIZ - 1);
savec = *q;
*q = '\0';
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
if (parsefile->fd == 0 && hist && something) {
HistEvent he;
INTOFF;
struct timeval tv;
char *tvptr;
#ifndef __minix
-#ifndef __minix_vmd
fd_set ifds;
-#endif
struct termios told, tnew;
int tsaved;
#endif
#include "error.h"
#include "mystring.h"
#include "builtins.h"
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
#include "myhistedit.h"
#endif
optschanged(void)
{
setinteractive(iflag);
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
histedit();
#endif
setjobctl(mflag);
#include "alias.h"
#include "show.h"
#include "eval.h"
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
#include "myhistedit.h"
#endif
whichprompt = which;
#ifndef NO_HISTORY
-#ifdef EDITLINE
- if (!editable)
-#else
if (!el)
-#endif /* EDITLINE */
#endif /* !NO_HISTORY */
out2str(getprompt(NULL));
}
#define TRACE(param)
#endif
-#if defined(__minix) && !defined(__NBSD_LIBC)
-typedef long quad_t; /* XXX */
-typedef unsigned long u_quad_t; /* XXX */
-#endif
-
/*
* $PchId: shell.h,v 1.7 2006/05/22 12:47:00 philip Exp $
*/
#include "error.h"
#include "trap.h"
#include "mystring.h"
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
#include "myhistedit.h"
#endif
#include "builtins.h"
-#if defined(__minix)
-#if !defined(__NBSD_LIBC)
-#define NO_SIGINTERRUPT
-#endif
-#define NO_SYS_SIGNAME
-#define NO_SYS_SIGLIST
-#endif
-
typedef void (*sig_T)(int);
/*
}
#endif
-#ifdef NO_SYS_SIGNAME
+#ifdef __minix
static char *strsigname(sig)
int sig;
{
case SIGILL: return "ill"; /* 4 */
case SIGTRAP: return "trap"; /* 5 */
case SIGABRT: return "abrt"; /* 6 */
-#ifdef __minix_vmd
- case SIGEMT: return "emt"; /* 7 */
-#else
case SIGBUS: return "bus"; /* 7 */
-#endif
case SIGFPE: return "fpe"; /* 8 */
case SIGKILL: return "kill"; /* 9 */
case SIGUSR1: return "usr1"; /* 10 */
case SIGPIPE: return "pipe"; /* 13 */
case SIGALRM: return "alrm"; /* 14 */
case SIGTERM: return "term"; /* 15 */
-#ifdef __minix_vmd
- case 16: return "Signal 16"; /* 16 */
-#else
case SIGEMT: return "emt"; /* 16 */
-#endif
case SIGCHLD: return "chld"; /* 17 */
case SIGCONT: return "cont"; /* 18 */
case SIGSTOP: return "stop"; /* 19 */
case SIGWINCH: return "winch"; /* 23 */
case SIGVTALRM: return "vtalrm"; /* 24 */
case SIGPROF: return "prof"; /* 25 */
-#ifdef __minix_vmd
- case SIGFPEMU: return "fpemu"; /* 30 */
-#endif
default: return "Signal n";
}
}
}
#endif
-#ifdef NO_SYS_SIGLIST
+#ifdef __minix
#include "signames.h"
char *strsiglist(sig)
int sig;
#include "error.h"
#include "mystring.h"
#include "parser.h"
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
#include "myhistedit.h"
#endif
STATIC struct var voptind;
STATIC const struct varinit varinit[] = {
-#if !defined(NO_HISTORY) && !defined(EDITLINE)
+#if !defined(NO_HISTORY)
{ &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=",
sethistsize },
#endif
+20130130:
+ With the shell update, and following update of 'test', some
+ modifications are needed in .profile and .ashrc.
+ If you use the defaults, simply execute the following for all
+ of your users:
+
+ # cp etc/ast/.ashrc ~/
+ # cp etc/ast/.profile ~/
+
20130114:
The terminfo update is also linked to the databases functions,
which means the tool used to generate the termcap entries has to
} # End of no-repeat.
# Let cd display the current directory on the status line.
-if [ "$-" : '.*i.*' -a -t 0 -a -f /usr/bin/tget ] && tget -flag hs
+if [ -t 0 -a -f /usr/bin/tget ] && tget -flag hs
then
+case $- in *i*)
hostname=$(expr $(uname -n) : '\([^.]*\)')
eval "cd()
{
}"
unset hostname
cd .
+ ;;
+esac
fi
# Login shell profile.
-# Erase character and erase line interrupt keys
-stty sane erase '^H' kill '^U'
+# Activate emacs keybindings and command line history support
+set -o emacs
# Check terminal type.
case $TERM in
# generate editline.c from various .c files
#
+# LSC: Needed by MINIX's ASH, so do not hide those
-e)
echo "$FILES" | tr ' ' '\012' | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#define protected static\n");
+ printf("#define protected /* LSC: see makelist static*/\n");
printf("#define SCCSID\n");
}
{