====== SHELL ======
===== Ignorar histórico do shell =====
Adicionar ao arquivo ''~/.bashrc'':
export HISTCONTROL=ignorespace
Quando for executar um comando no shell, colocar um espaço em branco
===== Script =====
==== Loop por linha em arquivo ====
while read i; do
echo $i
done < file.txt
===== .bashrc (exemplo raposo) =====
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# # ex - archive extractor
# # usage: ex
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) urar $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
export HISTCONTROL=ignorespace
export LANG="en_US"
export PS1='\[\e[0;33m\]\u@\h\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;33m\]\$\[\e[m\] \[\e[1;37m\]'
export VISUAL="vim"
alias ll="ls -l"
alias sudo="PS1='\[\e[0;31m\]\u@\h\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\\$\[\e[m\] \[\e[1;37m\]' sudo"