diff --git a/dir b/dir deleted file mode 100755 index ff20fec..0000000 --- a/dir +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -ls -lhAF --color=auto "$@" diff --git a/rsyn b/rsyn deleted file mode 100755 index 4e4466a..0000000 --- a/rsyn +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -rsync -vaSH "$@" diff --git a/shw b/shw index 0a2d139..1b4ce43 100755 --- a/shw +++ b/shw @@ -1,10 +1,12 @@ #!/bin/bash -# if $1 is a text file, less it -if file "$1" | grep -q text; then - less -FRX "$1" - -# otherwise, just dir it +# if stdin is coming from a pipe, run less +if [[ ! -t 0 ]]; then + less -FX +# if there is only one arg and it is not a directory, less it +elif [[ -z "$2" && ! -d "$1" ]]; then + less -FX "$1" +# otherwise, run dir else ls -lhAF --color=auto "$@" fi