[U-Boot-Users] script examples...

Wolfgang Denk wd at denx.de
Mon Jun 23 21:57:45 CEST 2003


In message <20030623193734.GB5179 at buici.com> you wrote:
> Do you mean a shell script?
> 
> Like,
> 
>   [ -f PATH ] && EXEC_THIS_COMMAND
>   [ ! -f PATH ] && EXEC_ANOTHER_COMMAND

This doesn't work, as the current implementation of  the  hush  shell
does  not  contain  a  "test"  command  (and "[" is just an alias for
"test").

You have to use the return status of existing commands, like

	if fdosls <some_filename_here>
	then run command_1
	else run command_2
	fi


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Ninety-Ninety Rule of Project Schedules:
        The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.




More information about the U-Boot mailing list