Portál AbcLinuxu, 26. července 2025 02:33
help test
, popřípadě man bash
a klíčové slovo test
#!/bin/bash echo "This scripts checks the existence of the messages file." echo "Checking..." if [ -f /var/log/messages ] then echo "/var/log/messages exists." fi echo echo "...done."
A trosku zjednodusime s identickym vysledkem #!/bin/bash echo -e "This scripts checks the existence of the messages file.\nChecking..." [ -f /var/log/messages ] && echo "/var/log/messages exists." echo -e "\n...done."
Prozkoumej si to za domaci ukol
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.