-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Testei o /bin/ls aqui também, da mesma maneira que você e aqui ele foi considerado arquivo regular.
$ [ -f /bin/ls ] && echo "Arquivo regular" Arquivo regular Será que não faltou colar uma linha do terminal? Quanto ao que é um arquivo regular, acho que os arquivos não regulares são os de dispositivos. $ [ -f /dev/stdout ] && echo "Arquivo regular" $ [ -f /dev/random ] && echo "Arquivo regular" $ [ -f /etc/passwd ] && echo "Arquivo regular" Arquivo regular Saudações, - -- Guilherme Magalhães Gall (GMGall) GPG Public Key ID: 0F498058 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAklIQgAACgkQZV3qXg9JgFhEpgCghTmFM35dfQsiFf62U8Ouznb0 GnoAni1+KuT+fBwT/M/jILuEaC6Nmiuw =7XIG -----END PGP SIGNATURE----- 2008/12/16 Eri Ramos Bastos <[email protected]>: > Na verdade não: > > $ [ -f /bin/ls ] && echo "Arquivo regular" > $ file /bin/ls > /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for > GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped > > Acho que o melhor é usar o comando file e testar via "grep -i ascii". > > Mas o melhor mesmo é fazer uma checagem melhor no seu script para não > acontecer de tentar jogar na tela um arquivo binário. :) > > []'s > Eri Ramos Bastos
