The first time I encountered a "shar"[0] I was amazed. It was very early in my career when I first encountered one and I had only seen shell scripts, archives, and packages, it was an interesting mash up.
In CS101 our final was to build a sudoku solver in C++. I think the best student time was a minute.
At the end of the semester I went to the professor’s office to ask about optimizations that could’ve been made and he showed me a bash one-liner that solved a sudoku in under a second. I wish I remembered what the one liner was!
/shameless plug - In my defense I originally read the title as "..you have done.." vs "..you have seen done.."
Two of my OSS projects are Bash and I'm rather proud of them:
A pretty cool shell-centric template engine:
* https://github.com/TekWizely/bash-tpl
* Has full bats tests to confirm compatibility with Bash 3.2 onward
* Makes heavy use of Bash regexes
A wrapper over update-alternatives that enables user-level configurations:
* https://github.com/TekWizely/my-alternatives
* Versions for Debian, SUSE, and RedHat
* Supports per-shell level configurations as well
Many years ago, as a relative newbie in the industry, working a 1099 gig for a big4 accounting firm, I automated a netbackup media server migration with a for loop. Ended up saving myself and the more senior contractor (who was doing this process manually) about a day's work. Best thing I ever programmed.
25 comments
[ 4.8 ms ] story [ 66.8 ms ] threadhttps://en.wikipedia.org/wiki/Shar
https://github.com/bittorf/shell_snake
There is also a tetris.sh lying around somewhere...
At the end of the semester I went to the professor’s office to ask about optimizations that could’ve been made and he showed me a bash one-liner that solved a sudoku in under a second. I wish I remembered what the one liner was!
Two of my OSS projects are Bash and I'm rather proud of them:
A pretty cool shell-centric template engine: * https://github.com/TekWizely/bash-tpl * Has full bats tests to confirm compatibility with Bash 3.2 onward * Makes heavy use of Bash regexes
A wrapper over update-alternatives that enables user-level configurations: * https://github.com/TekWizely/my-alternatives * Versions for Debian, SUSE, and RedHat * Supports per-shell level configurations as well
du -sk ./* | sort -nr | awk 'BEGIN{ pref[1]="K"; pref[2]="M"; pref[3]="G";} { total = total + $1; x = $1; y = 1; while( x > 1024 ) { x = (x + 1023)/1024; y++; } printf("%g%s\t%s\n",int(x10)/10,pref[y],$2); } END { y = 1; while( total > 1024 ) { total = (total + 1023)/1024; y++; } printf("Total: %g%s\n",int(total10)/10,pref[y]); }'
https://github.com/dylanaraps/neofetch/blob/master/neofetch
(1) https://github.com/p8952/bocker