shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: duvida em script basico


From: Timeu F. Oliveira
Subject: Re: duvida em script basico
Date: Thu, 22 Mar 2007 12:40:42 -0000
User-agent: eGroups-EW/0.82

bom o script está assim agora:
#!/bin/bash
echo "digite o arquivo:"
read ARQUIVO
test -e "$ARQUIVO" && echo "existe"
test -d "$ARQUIVO" && echo "eh um diretorio"
test -f "$ARQUIVO" && echo "e eh um arquivo"

mas... se não existir ele tem q dizer que nao existe... como faz? o.O

--- Em address@hidden, "Timeu F. Oliveira"
<heathcliff_lnx@...> escreveu
>
> olá pessoas... sou novo na lista e estou tentando aprender o shell
> script... bom... estou tentando fazer um script que identifique se o
> arquivo ou diretorio existe... em caso positivo escrever se eh arquivo
> ou diretorio caso nao exista escrever que não existe... bom nisso q
> postarei abaixo era pra ser a parte de identificar... mas n tah
> funcionando sendo arquivo ou diretorio ele diz q eh diretorio...
> 
> #!/bin/bash
> echo "digite o arquivo:"
> read ARQUIVO
> test $ARQUIVO!=-d && echo "diretorio"
> exit
> test $ARQUIVO=-f && echo "arquivo"
> 
> ideias?
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]