Skip to content

Instantly share code, notes, and snippets.

@ataliba
Created May 1, 2012 16:13
Show Gist options
  • Save ataliba/2569253 to your computer and use it in GitHub Desktop.
Save ataliba/2569253 to your computer and use it in GitHub Desktop.
Somente para histórico - zzinverte - inverte uma string ( faz o mesmo que a zzvira, que eu não conhecia )
# ----------------------------------------------------------------------------
# Inverte a string passada como parâmetro para o comando
# Uso: zzinverte
# Ex.: zzinverte string
#
# Autor: Ataliba Teixeira, www.ataliba.eti.br
# Desde: 2012-04-30
# Versão: 1
# Licença: GPL
# ----------------------------------------------------------------------------
zzinverte ()
{
zzzz -h inverte "$1" && return
echo $1 | awk '{ for(i=length($0);i>=1;i--) printf("%s",substr($0,i,1)); }'
echo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment