promenne ve scriptu - Takhle je to - zatim vyreseno :-)

Libor Chocholaty libor_ml1 na mts.cz
Pátek Květen 19 13:37:55 CEST 2006


Vancl Miroslav (QRIS) wrote:
>>    
>> zapisy
>> $ . vars
>> a
>> $ . ./vars
>> jsou ekvivalentni, takze tim to jiste nebylo.
>>
>>     
> 	Omyl, neni tomu tak ! 
> 	Zapis 
> 	$ . vars
> 	pousti skript z nektere cesty v PATH a pokud tam neni uvedena cesta
> ".", pak se tento skript nespusti. 
> 	Zapis
> 	$ . ./vars
> 	spousti skript z aktualniho adresare a proto se spusti.
>   
Pravdu jsme meli tak trochu oba, viz SHELL BUILTIN COMMANDS:
 .  filename [arguments]
source filename [arguments]
       Read  and  execute commands from filename in the current shell 
environment and return the exit
       status of the last command executed from filename.  If filename 
does not contain a slash, file
       names  in  PATH  are used to find the directory containing 
filename.  The file searched for in
       PATH need not be executable.  When bash is  not  in  posix  
mode,  the  current  directory  is
       searched  if  no file is found in PATH.  If the sourcepath option 
to the shopt builtin command
       is turned off, the PATH is not searched.  If any arguments are 
supplied, they become the posi-
       tional  parameters  when  filename  is  executed.   Otherwise  
the  positional  parameters are
       unchanged.  The return status is the status of the last command 
exited within the script (0 if
       no commands are executed), and false if filename is not found or 
cannot be read.

Libor




Další informace o konferenci Linux