~/ learn/ comp-325/ cards/ The C shell dialect: same ideas, different language
1 of 9

The Bourne original — five lines to translate

The Bourne original — five lines to translate

Answer

#!/bin/sh count=0 export EDITOR=vi count=`expr $count + 1` echo "got # arguments; count is count"

One assignment verb, an explicit export, a forked `expr` for the arithmetic, and `$#` for the argument count. Every one of those four decisions is spelled differently in the C shell.

S&K 3e ch14 §14.3-14.5; csh(1) — see the warning callout for §14.4.2

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/451509a4-4a8f-4bf6-8d89-6b3e524ece6a/flashcard utf-8 LF