Skip to content

Instantly share code, notes, and snippets.

@swdyh
Created August 14, 2009 10:04
Show Gist options
  • Select an option

  • Save swdyh/167744 to your computer and use it in GitHub Desktop.

Select an option

Save swdyh/167744 to your computer and use it in GitHub Desktop.
#!/bin/sh
ls='/bin/ls -vG'
lv='/opt/local/bin/lv -c'
if [ $# -ne 0 ]
then
eval last=\$\{$(expr $#)\}
if [ -d $last ]
then
# echo '[Dir]'
$ls $*
elif [ -f $last ]
then
$lv $*
fi
else
if [ -t 0 ]
then
$ls
else
$lv
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment