28-10-2020, 03:06 PM
I am very far from being a shell guru.
All of the scripts I use are very simple. Some are /bin/sh and some are /bin/csh
I guess that bash should be similar to 'sh'.
In the Bourne shell, the equivalent of 'foreach' is 'for' with quite a different syntax.
If my example generates errors in /bin/csh please let me know and I can correct.
However, it is there to show a simple logic that can be translated to other syntaxes.
All of the scripts I use are very simple. Some are /bin/sh and some are /bin/csh
I guess that bash should be similar to 'sh'.
In the Bourne shell, the equivalent of 'foreach' is 'for' with quite a different syntax.
If my example generates errors in /bin/csh please let me know and I can correct.
However, it is there to show a simple logic that can be translated to other syntaxes.


![[+]](https://www.voynich.ninja/images/collapse_collapsed.png)