Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!hoptoad!rtech!daveb From: daveb@rtech.UUCP Newsgroups: comp.unix.questions Subject: RE: why does this script... ( : and # ) Message-ID: <913@rtech.UUCP> Date: Mon, 15-Jun-87 01:45:58 EDT Article-I.D.: rtech.913 Posted: Mon Jun 15 01:45:58 1987 Date-Received: Tue, 16-Jun-87 01:27:41 EDT Reply-To: daveb@rtech.UUCP (Dave Brower) Organization: Relational Technology, Alameda CA Lines: 35 As Doug Gwyn noted, the Bourne shell ':' is a command, not a comment character. However, it is still what I suggest you put in the head of your shell scripts for maximum portability. It's clear you can't have a '#', because that implies csh on some kernels. You can't rely on '#!/bin/sh', because some kernels don't undertand it. (Yes, there are some that recoginize '#', but not '#!/..."). One option is to put a blank line at the beginning, which will result in Bourne shell execution. Unfortunately, blank lines have an annoying habit of being removed when someone casually edits a file. ---------------- easy to lose this line-> # submit -- run cmd in background, it's output to OUT nohup $* > OUT 2>&1 & If you put a ':' on the first line, WITH NOTHING ELSE, you won't accidentally delete the line and you will get /bin/sh. Why ':'? Because it's easy to type, innocuous, and usually a built-in making it cheap to use. ---------------- harder to lose this---->: # submit -- run cmd in background, it's output to OUT nohup $* > OUT 2>&1 & You are asking for trouble if you put comments on the line with the ':' ---------------- NO NO NO--------------->: submit -- run cmd in background, it's output to OUT nohup $* > OUT 2>&1 & -dB -- {amdahl, cbosgd, mtxinu, ptsfa, sun}!rtech!daveb daveb@rtech.uucp