Rozne formy zapisu "if [ !" OR "if ! ["

AntiTrust - AT antitrust na centrum.sk
Středa Září 22 15:47:14 CEST 2004


DD.

Chcem sa opytat, co je spravna forma zapisu $SUBJ, resp. cim sa lisia, 
resp. ci su zhodne-totozne [oba zapisy =(?) ten isty "vykon"-vysledok??].

Co som uz zistil, ze casto v nejakej ciarke ci vykricniku (ci sposobe 
umiestnenia) je *velky* rozdiel (niekedy "smrtelny" :), takze sa radsej 
spytam profikov.

V
http://www.tldp.org/LDP/abs/html/fto.html
som nasiel obe formy zapisu.




V SARGE tiez:
[pwd = /etc/init.d]
cat * | igrep -c '\[ !'
37

cat * | igrep -c '\! \['
4


#igrep '\! \[' .
./inetd:if ! [ -x /usr/sbin/inetd ]; then
./inetd:        if ! [ -x /usr/bin/rpcinfo ]
./networking:if ! [ -x /sbin/ifup ]; then
./hdparm:if ! [ "$raidstat" = 'OK' ]; then


#igrep '\[ !' .
./makedev:      if [ ! -e /dev/.devfsd ]; then
./procps.sh:               if [ ! -r /etc/sysctl.conf ]
./mountvirtfs:  if [ ! -d $3 ]
./mountvirtfs:if [ -n "$DO_MTAB" ] && [ ! -f /etc/mtab ]
./mountvirtfs:          if [ ! -d /dev/pts ]
./mountvirtfs:          if dir_writable /dev && [ ! -c /dev/ptmx ]
./mountall.sh:if [ ! -p $INITCTL ]
./bootmisc.sh:if [ ! -e /dev/.devfsd ] && [ -c /dev/ttyp0 ]
./bootclean.sh: if [ ! -x /bin/find ] && [ ! -x /usr/bin/find ]
./bootclean.sh: if [ ! -x /bin/xargs ] && [ ! -x /usr/bin/xargs ]
./checkfs.sh:if [ ! -f /fastboot ]
./rc:                   [ ! -f $i ] && continue
./rc:           [ ! -f $i ] && continue
./rc:                   [ -f $previous_start ] && [ ! -f $stop ] && continue
./rcS:  [ ! -f "$i" ] && continue
./hwclock.sh:           if [ ! -f /etc/adjtime ]
./hwclockfirst.sh:[ ! -x /sbin/hwclock ] && exit 0
./hwclockfirst.sh:              if [ ! -r /etc/localtime ]
./sysklogd:    if [ ! -e /dev/xconsole ]; then
./sysklogd:    if [ ! -f $pidfile ]
./sysklogd:    if [ ! -d /proc/$pid ]
./console-screen.sh:    if [ ! $CONSOLE_TYPE = "serial" ]  ; then
./hotplug:if [ ! -f /proc/sys/kernel/hotplug ]; then
./portmap:      if [ ! -f /var/run/portmap.upgrade-state ]; then
./keymap.sh:       if [ ! -x /proc/1 ]; then
./ssh:    if [ ! -d /var/run/sshd ]; then
./ssh:    if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then
./kdm:    if [ ! -f $PIDFILE ]; then
./kdm:      if [ ! -e $UPGRADEFILE ]; then
./klogd:    if [ ! -f $pidfile ]
./klogd:    if [ ! -d /proc/$pid ]
./discover:        if [ ! -e $CDROM ] && [ ! -e $ALTCDROM ]
./discover:        elif [ ! -b $CDROM ] && [ ! -e $ALTCDROM ]
./discover:        elif [ -e /dev/cdrom$CDNUM ] && [ ! -L /dev/cdrom$CDNUM ]
./discover:        if [ -L /dev/cdrom ] || [ ! -e /dev/cdrom ]
./add-many-Xusers:              if [ ! -d $home ]; then
Binary file ./.add-many-Xusers.swp matches
./adduser-correct-skel-config:  if [ ! -e "$inputfile" ]       # Check 
if file exists.


Diky

AT

-=x=-
Skontrolované antivírovým programom NOD32



Další informace o konferenci Linux