File: test7.esh

package info (click to toggle)
esh 0.8-7
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 508 kB
  • ctags: 542
  • sloc: ansic: 3,608; lisp: 166; makefile: 72
file content (21 lines) | stat: -rw-r--r-- 424 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

#
# This is a sample .eshrc that implements a restricted shell.
#

(define restricted
  ~(print "Sorry, but this function has been restricted." (nl)))

(define for-each
  ~(if ~(not-null? (rot))
       ~(begin ((rot) (rot))
               (for-each (cdr (l-stack))))
       ()))

(define restrict-command
  ~(if ~(not-null? (top))
       ~(define (pop) (list restricted))
       ()))

(for-each restrict-command cd fg bg)