Page MenuHomePhabricator
Authored By
jbond
Dec 30 2019, 10:45 AM
Size
540 B
Referenced Files
None
Subscribers
None
$ cat t.sh
#=!/bin/sh
set -x
FETCH_HEAD_OR_EMPTY=$([ -z "${1:-}" ] || echo FETCH_HEAD)
printf 'HERE %s\n' "${FETCH_HEAD_OR_EMPTY}"
FETCH_HEAD_OR_EMPTY=${1:-FETCH_HEAD}
printf 'HERE %s\n' "${FETCH_HEAD_OR_EMPTY}"
$ ./t.sh
+ [ -z ]
+ FETCH_HEAD_OR_EMPTY=
+ printf HERE %s\n
HERE
+ FETCH_HEAD_OR_EMPTY=FETCH_HEAD
+ printf HERE %s\n FETCH_HEAD
HERE FETCH_HEAD
$ ./t.sh foo
+ [ -z foo ]
+ echo FETCH_HEAD
+ FETCH_HEAD_OR_EMPTY=FETCH_HEAD
+ printf HERE %s\n FETCH_HEAD
HERE FETCH_HEAD
+ FETCH_HEAD_OR_EMPTY=foo
+ printf HERE %s\n foo
HERE foo

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8275328
Default Alt Text
raw.txt (540 B)

Event Timeline