CVS commit: src/etc
"Robert Elz" <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module Name: src Committed By: kre Date: Thu Mar 5 19:06:14 UTC 2026 Modified Files: src/etc: getramdisksize Log Message: Fix incorrect syntax for some shells In a world long vanished, the ascii char set did not have the | character (0x7c) as a standard member, and could not be relied upon existing. In systems only found today in archaeological digs, that was handled by making '^' be the sh symbol for a pipe. That meant that the regular expression notation for negating a character class ([^stuff]) couldn't be used in shell patterns, and so ! was used there instead of the ^. The ^ did not bother use in REs as those almost always need to be quoted when included in a shell command anyway - but quoting of shell patterns would defeat their use as a pattern, so couldn't be used there. In more modern times, this excuse for the difference has long gone, ^ isn't the pipe symbol in any shell that is likely to be encountered, and so most shells allow either ^ or ! to represent negation of a character class - ^ for compat with REs, and ! for compat with old scripts. However, there are a few holdouts, dash, mksh, bosh (which actually still allows ^ to represent pipes, bizarrely) and even our own /bin/ksh only allow ! in [] as the negation operator. So, use ! instead of ^ (! works everywhere). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/etc/getramdisksize Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.