Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Obviously this isn't my whole ~/.bashrc, but it's the part I wrote today.
- # I think I hate bash.
- # For the lazy: It's an alias for the ls command, allowing me to toggle the -A flag with -a, and applying certain arguments I want to apply each time.
- # It doesn't have a "clean" argument because I can't imagine I'll ever want/need one.
- ls()
- {
- local arr=""
- local all=true
- for val in $@
- do
- if [ $# -lt 1 ]; then
- break
- fi
- if [ $val = "-a" ]; then
- all=false
- else
- arr="$arr $val"
- fi
- done
- local ls=$(which ls)
- local cmd=""
- if [ $all = false ]; then
- cmd="$ls -x --group-directories-first --color=auto $arr"
- else
- cmd="$ls -A -x --group-directories-first --color=auto $arr"
- fi
- $cmd
- }
Advertisement
Add Comment
Please, Sign In to add comment