Rosetta Code:Village Pump/Bash examples: Difference between revisions

'''tsch'''! Don't '''dash''' and '''bash'''. Opening a can of bu'''csh'''? '''psh'''! '''sh'''h! People are trying to sleep.
(Two shell highlighting classes then?)
('''tsch'''! Don't '''dash''' and '''bash'''. Opening a can of bu'''csh'''? '''psh'''! '''sh'''h! People are trying to sleep.)
Line 5:
:::: For anything nontrivial in the shell (e.g. setting environment variables, control structures, builtin commands, redirections other than stdin-from-file or stdout-to-file, etc.), the C shell (csh, tcsh) family is significantly different from the POSIX shell (csh, bash) family. --[[User:Kevin Reid|Kevin Reid]] 22:55, 12 February 2009 (UTC)
:::::How about <nowiki><lang csh> for C shells (which she sells down by the C shore) and <lang posh> for POSIX shells?</nowiki> --[[User:Mwn3d|Mwn3d]] 22:59, 12 February 2009 (UTC)
::::::People don't always know whether they're writing for '''bash''' or '''sh'''. I discovered this when I tried manually building Cinelerra a while back on Ubuntu. Their script had
<lang bash>#!/bin/sh</lang>
::::::at the beginning, indicating to the system they wanted a POSIX shell. That edition of Ubuntu had /bin/sh symlinked to '''dash''', which is a ''strictly'' POSIX shell. And it turned out part of their build script depended on '''bash''' extensions. Symlinking /bin/sh to /bin/bash fixed most of the problems. However, the '''csh''' lang ID idea is good...is '''tcsh''' the same? And what do we do for '''psh''' and friends? --[[User:Short Circuit|Short Circuit]] 06:34, 13 February 2009 (UTC)