.bashrc: add lscat; +1 tmp file

This commit is contained in:
Lexi / Zoe 2019-01-12 14:16:29 +01:00
parent dd9f6470b8
commit 0262d659bb
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
2 changed files with 32 additions and 1 deletions

19
.bashrc
View file

@ -85,11 +85,28 @@ calc() {
echo "$@" | bc
}
# Show content of something, `ls` for dirs (and special files), `cat` for files
lscat() {
[[ $# -eq 0 ]] && ls -la && return
printnewline=""
for f in "$@"; do
[[ $printnewline ]] && echo
printnewline=1
if [[ -f $f ]]; then
[[ $# -gt 1 ]] && echo "-- cat \"$f\""
cat "$f"
else
[[ $# -gt 1 ]] && echo "-- ls \"$f\""
ls -la "$f"
fi
done
}
# Define colors for bash prompt (will also be used in .bashrc.local)
TRED='\[\e[0;31m\]' # Red
TGREEN='\[\e[0;32m\]' # Green
TCYANB='\[\e[1;36m\]' # Cyan bold
TBLUE='\[\e[1;34m\]' # Blue
TBLUE='\[\e[0;34m\]' # Blue
TWHITEB='\[\e[1;37m\]' # White bold
TRESET='\[\e[0m\]' # Text Reset