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

Re: [OT] help in bash



On Thu, 2005-07-14 at 11:32 +0200, paolo wrote:
> No, ma grazie lo stesso.
> A me piacerebbe mettere nella condizione un comando
> e valutare il suo exit code.
> 
L'exit code sta in $?, ma con la command substitution fai esattamente
quello che ti serve!

Ad esempio:

 while [ ! $(cat /etc/shadow 2> /dev/null) ];do
	echo "accesso negato"
	sleep 1
 done

Puo` andare?

Seguila meglio quella guida!! ;p

Ciao,
Dario
-- 
<<This happens because I choose it to happen!>>
(Raistlin Majere, DragonLance Chronicles -Dragons of Spring Drawning-)
----------------------------------------------------------------------
Dario Faggioli
GNU/Linux Registered User: #340657

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: