dylanaraps / pure-sh-bible

📖 A collection of pure POSIX sh alternatives to external processes.
MIT License
6.45k stars 281 forks source link

Additional ideas and examples #19

Open spiralofhope opened 4 years ago

spiralofhope commented 4 years ago

Thanks for your work. Since discovering it, I always refer to this project when I'm working on new script ideas.

I myself have kept notes and have created a number of examples.

https://github.com/spiralofhope/shell-random/tree/master/live/sh

Although we have very different styles (for code and examples), some of my stuff might be useful for your work. From now on I'll try to refine my examples and provide them for your consideration, but there may be old stuff you'd be interested in absorbing into this project, including some oddities.

For example:

https://github.com/spiralofhope/shell-random/blob/master/live/sh/scripts/examples/comments.sh

# A whole HEREDOC block which can be trivially commented in or out to enable/disable the block.
# Also code foldable.
:<<'}'
{
  \echo  'This would not be run.'
}

# Notice the commenting of the following line.
#:<<'}'
{
  \echo  'This WOULD be run.'
}