-xBurada ne anlama geliyor?
if [ -x /etc/rc.local ] then
Bu kılavuz sayfasını nasıl bulabilirim if?
help ifmi
-xBurada ne anlama geliyor?
if [ -x /etc/rc.local ] then
Bu kılavuz sayfasını nasıl bulabilirim if?
help ifmi
Yanıtlar:
Gönderen man bashsayfa (özellikle ŞARTLI EXPRESSIONS bölümü):
-a file
True if file exists.
-b file
True if file exists and is a block special file.
-c file
True if file exists and is a character special file.
-d file
True if file exists and is a directory.
-e file
True if file exists.
-f file
True if file exists and is a regular file.
-g file
True if file exists and is set-group-id.
-h file
True if file exists and is a symbolic link.
-k file
True if file exists and its ``sticky'' bit is set.
-p file
True if file exists and is a named pipe (FIFO).
-r file
True if file exists and is readable.
-s file
True if file exists and has a size greater than zero.
-t fd True if file descriptor fd is open and refers to a terminal.
-u file
True if file exists and its set-user-id bit is set.
-w file
True if file exists and is writable.
-x file
True if file exists and is executable.
[...]
testçağırdığınızda, testikili dosyayı çağırmazsınız . Bunun yerine, testbelgelerin bulunduğu bash inşasını help testbaşka yerlere de çağırıyorsunuz . man testbu nedenle bazı durumlarda yanıltıcı olabilir.
ifkendisi bir kabuk anahtar kelimedir, bu yüzden onunla ilgili bilgi bulabilirsiniz help if. ifkendisi yalnızca bir sonraki komutun doğru (0) veya yanlış (sıfır değil) döndürdüğüne bağlı olarak dallanır. Gerçekten istediğin şey, man [ya da man test, [takma adın nerede olduğu test. Bu ifade aslında test -x /etc/rc.local, hangi dosyanın var olup olmadığını ve çalıştırılabilir olduğunu (veya arama iznine sahip olup olmadığını) test eden bir uygulama .
man [de çalışır.
if, kabuk anahtar kelimesi içinde kabuk değildir. Bunu type ifkontrol etmek için bu komutu çalıştırın.
Kimden info test:
`-x FILE'
True if FILE exists and execute permission is granted (or search permission, if it is a directory).
Bir dizinde içine cd yazabilmek için yürütme izni gerekir (yani, bir dizini geçerli çalışma dizininiz yapmak için).
İçindeki dosyaların "inode" bilgilerine erişmek için bir dizinde yürütme gereklidir. İçindeki dosyaların inode'larını okumak için bir dizinde arama yapmak için buna ihtiyacınız var. Bu nedenle, bir dizindeki yürütme iznine genellikle bunun yerine arama izni denir.