OILS / demo / 06-history.sh View on Github | oilshell.org

27 lines, 12 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# demo/06-history.sh <function name>
5#
6# TODO: move into test/gold -- OSH doesn't have histexpand.
7
8set -o nounset
9set -o pipefail
10set -o errexit
11
12main() {
13 echo hi
14 # Does this work non interacitvely? Nope.
15 echo !$
16 echo !!
17
18 # Hm this doesn't work either? It's only for turning OFF in interactive
19 # shells maybe?
20 set -o histexpand
21
22 echo hi
23 echo !$
24 echo !!
25}
26
27"$@"