Skip to content

Instantly share code, notes, and snippets.

@tommystanton
Created September 17, 2012 18:49
Show Gist options
  • Save tommystanton/3739044 to your computer and use it in GitHub Desktop.
Save tommystanton/3739044 to your computer and use it in GitHub Desktop.
GNU ed + GNU readline
#!/bin/sh
# Try to add GNU readline support to GNU ed
hash rlwrap 2>&-
if (( $? == 0 )); then
exec /usr/bin/rlwrap /bin/ed "$@"
else
exec /bin/ed "$@"
fi
@vyuh
Copy link

vyuh commented Sep 9, 2014

is &- equivalent to /dev/null ?

@Tpaefawzen
Copy link

The &- itself is not the /dev/null; it means to close the stream with such number (if I remember correctly). If you're worring about that why not just 2>/dev/null?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment