`[' (the `test' command) is used to evaluate the GATEWAY environment variable. `&&' is a shell control operator to evaluate an AND list. It is often used like this instead of an if/then construct. The `route' command is only executed if the test evaluated to zero, i.e., GATEWAY is set. For details, see the manual pages for `[' (or `test'), `bash' (or your particular shell) and `route'.
Andreas > -----Original Message----- > From: A. Scott White [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 17, 2000 11:05 > To: debian-user@lists.debian.org > Subject: Help with the /etc/init.d/network > > > Can anyone tell me exactly what this line accomplishes: > > [ "${GATEWAY}" ] && route add default gw ${GATEWAY} metric 1 > > I'm pretty sure it adds the default gateway setting for > TCP/IP, but I don't > understand what it means, exactly. Could you explain: > 1. The script syntax > 2. the commands involved > > I'd appreciate it. Thanks. > > ==================================================== > A. Scott White > Director of Information Systems and Product Strategy > Healthcare Solutions Group > Affiliated Computer Services, Inc. > [EMAIL PROTECTED] > ==================================================== >