- # demo for negation ('!') before an [ ] expression. This should work
- # in POSIX shells, and seems to work in busybox sh BusyBox v1.21.1
- # (Ubuntu 1:1.21.0-1ubuntu1), too
- $ busybox sh -c 'if [ -f asdsad ] ; then echo hi ; else echo ho ; fi'
- ho
- $ busybox sh -c 'if ! [ -f asdsad ] ; then echo hi ; else echo ho ; fi'
- hi
busybox sh negation before [ ]
Posted by Anonymous on Mon 2nd Sep 2019 07:22
raw | new post
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.