File: echo

package info (click to toggle)
noweb 2.13-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,540 kB
  • sloc: sh: 2,580; ansic: 1,829; makefile: 903; perl: 781; lisp: 757; awk: 174; csh: 3
file content (27 lines) | stat: -rwxr-xr-x 295 bytes parent folder | download | duplicates (9)
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
#!/bin/sh

# version of echo that does -n

if [ "x$1" = "x-n" ]; then
  shift
  cat << echoEOF | tr -d '\012'
$*
echoEOF

else
  cat << echoEOF
$*
echoEOF

fi

exit 0


if [ -x /bin/echo ]; then
  exec /bin/echo "$@"
elif [ -x /usr/bin/echo ]; then
  exec /usr/bin/echo "$@"
else
  echo "$@"
fi