|
|
|
|
|
by mazambazz
703 days ago
|
|
Hard disagree. I've written plenty in both. They both have their strengths, but bash is just more efficient if you're working with the filesystem. The UNIX philosophy of "do one thing and do it well" shines here. Python is more powerful but it's a double-edged sword. If I want to read a file containing API endpoints, send a request to them for some JSON, and do some parsing, I don't want to need or want to deal with importing modules, opening file objects, using dictionaries, methods, functions, etc. Why do that when I can literally just
```
N=0
while read -r URL; do
curl "$URL" | jq '.data[].someProp' | grep -v "filter" > "$N.data"
N="$((N+1))"
done < ./links.txt
``` The other thing is bash makes it exceptionally easier to integrate across different system tools. Need to grab something from a remote with `rsync`, edit some exif, upload it to a CDN? That's 3 commands in a row, versus god knows what libraries, objects, and methods you need to deal with in Python. |
|