pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS


busybox sh negation before [ ]
Posted by Anonymous on Mon 2nd Sep 2019 07:22
raw | new post

  1. # demo for negation ('!') before an [ ] expression. This should work
  2. # in POSIX shells, and seems to work in busybox sh BusyBox v1.21.1
  3. # (Ubuntu 1:1.21.0-1ubuntu1), too
  4. $ busybox sh -c 'if [ -f asdsad ] ; then echo hi ; else echo ho ; fi'
  5. ho
  6. $ busybox sh -c 'if ! [ -f asdsad ] ; then echo hi ; else echo ho ; fi'
  7. hi

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at