ソースを参照

~/.bin/l: Overcomplicate (and view executables)

If the first arg is not a directory or a file, see if we can find it
using `which` and view that file.  E.g. `l l` shows the source code of
`l` itself.

This makes the code much more complicated than before, but I do this so
often, so maybe I'll use it.
Lu Stadler 7 年 前
コミット
a4d75f2bcd
共有1 個のファイルを変更した8 個の追加4 個の削除を含む
  1. 8 4
      .bin/l

+ 8 - 4
.bin/l

@ -2,8 +2,12 @@
2 2
3 3
# ls or less anything in your filesystem (depending on what it is).
4 4
5
if [ -d $1 ]; then
6
	ls --group-directories-first --color=auto $1
7
elif [ -f $1 ]; then
8
	less $1
5
if [ -d "$1" ]; then
6
	ls --group-directories-first --color=auto "$1"
7
elif [ -f "$1" ]; then
8
	less "$1"
9
elif which "$1" &> /dev/null; then
10
	less `which $1`
11
else
12
	ls --group-directories-first --color=auto $*
9 13
fi