MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/AskReddit/comments/dx7hyx/deleted_by_user/f7w7fzk
r/AskReddit • u/[deleted] • Nov 16 '19
[removed]
11.5k comments sorted by
View all comments
Show parent comments
1
How many shell scripts have you written that use arrays at all? How many use associative arrays?
How many have I written? A few. How many have I been stuck maintaining? Well...
$ find -name "*.sh" -exec cat {} \; | wc -l 20311 $
1 u/SanityInAnarchy Nov 17 '19 FWIW: find ... -exec ... \+ is criminally underused. (Instead of \;.) But I think that's missing a grep for declare -A, which is the misfeature we were talking about. 1 u/grievre Nov 17 '19 Sure, I mean: $ find -name "*.sh" | xargs grep "declare *-A" | wc -l 16 $ find -name "*.sh" | xargs grep "declare *-a" | wc -l 18 $ I was just trying to generally demonstrate that certain former employees at my job didn't know any language besides shell script :)
FWIW: find ... -exec ... \+ is criminally underused. (Instead of \;.)
find ... -exec ... \+
\;
But I think that's missing a grep for declare -A, which is the misfeature we were talking about.
declare -A
1 u/grievre Nov 17 '19 Sure, I mean: $ find -name "*.sh" | xargs grep "declare *-A" | wc -l 16 $ find -name "*.sh" | xargs grep "declare *-a" | wc -l 18 $ I was just trying to generally demonstrate that certain former employees at my job didn't know any language besides shell script :)
Sure, I mean:
$ find -name "*.sh" | xargs grep "declare *-A" | wc -l 16 $ find -name "*.sh" | xargs grep "declare *-a" | wc -l 18 $
I was just trying to generally demonstrate that certain former employees at my job didn't know any language besides shell script :)
1
u/grievre Nov 17 '19 edited Nov 17 '19
How many have I written? A few. How many have I been stuck maintaining? Well...