>year of the current
>not scripting in bash
excuse me?
Year of the current
I use sh. It's nice to not need to install bash to use my scripts.
I use actual programming languages instead. I like portability and non-cancerous/less cancerous syntax and semantics.
>need some fast file manipulation
>boot up fish
>need something a little more complex
>write a python script so i can actually do it without wishing for death or having to google for every single retarded arcane weird syntax detail
when would i use bash script
I use sh for scripts and zsh as an interactive shell.
>What kind of hipster-ass distribution are you using that doesn't have bash as its default shell?
*BSDs, debian / ubuntu etc use dash as default i believe but use bash for users
how is bash not portable? it runs on almost every modern OS.
if anyone wants to discuss this topic but with a cute liyu0109 op please visit:
OpenBSD uses ksh by default, which is similar to dash.
>linux
>bsd
>homOSeX
>modern
no
And I'm sure even that's a moot point since apart from miserable core userland from the 70s there are probably lots of tools missing in each other.
Why are there 2 threads?
It runs on Windows too.
It's a ksh88 clone
while dash is based on netbsd sh
Not really, though.
msdn.microsoft.com
Now go play outside, kiddo
It's slow and doesn't support everything, faggot. And it never will. And history suggests that MS will just leave it as half-assed.
More important, I don't see what it offers over a real programming language. And you wish bash had as good package management. At least as long Perl isn't concerned.
Bash is a part of the GNU project. I guess distros that don't want to depend on their software will use something else.
...
R8 my script
#!/bin/bash
tmpfilename=$(mktemp)
currdir=${PWD##*/}
for name in `ls`
do
if [[ $name =~ .*\.(mkv|mp4|avi|webm) ]]
then
echo "$name" >> $tmpfilename
fi
done
mv $tmpfilename "${currdir}.m3u"
chmod 644 "${currdir}.m3u"
Kinda expected asm to be faster.
youtube.com
reminder that BASH is not a good SH scripting replacement
OpenBSD
>bash
absolute shit
any kind of shell scripting is a meme for anything but incredibly basic tasks
it's not 1970 anymore bryan
Why use bash over python? Can you make programs in bash????
but i do senpai
cronjobs are better than init too
What is a "basic task"? There are programs written in shell, e.g. Pass.
say quickly parse some log files
programs have been written in shell, yes
that does not mean it is a good idea
Bash is fairly feature rich compared to legacy shell, so you can. And of course it being a shell, calling other programs and piping is trivial, wheres in Python you have to import multiple modules for tasks that are builtin in shell, and sanitize input more strictly.
E.g. regex in bash is simply:
[[ string =~ expression ]]
Python:
import re
blah blah
There are many ways to "quickly" parse log files in shell, from builtin to using awk. Shell is probably as easy as any other interpreted language, if not easier.
exactly, it's fine for that
when things get more complex you want to use a better language
>programs are faster than scripts
wow
what in the fuck
fucking luajit
>bash
Only in a sick, degenerate, Jewified society is something this morally abhorrent is possible
I personally use mksh for interactive, rc for scripting.
Dude if you aint scripting all your shit in bleading edge object oriented perl you're doing it wrong.
even as powerful as bash builtins are nowadays there are still a shitload of things you have to fork and exec external shit to actually do anything semi useful in a shell and some shit that's pretty much fucking required in shell scripting like jq or curl might not even be installed.
Granted, in terms of "core utils" you generally don't need to worry about BSD garbage most times, but sadly you have all these "cli cool kid" mac hipster fags with the most garbo ass coreutils bitching about how their grep doesn't recognize option -P. fuck BSD shit utils so much.
>all these cucks using garbage ass ash, dash or """sh""" for scripting
you're all fucking plebs with slow ass shellscripts.
I bet you kids don't even know about shit like mapfile, arrays, read splitting, many of the fucking basic parameter expansions to avoid making calls to slow ass DSLs like awk, sed, etc.
#!/bin/bash
while :
do
IFS=$'\n' read -d '' -ra toparray
>for name in `ls`
wtf you doing you literal nigger, use globbing here you fucking nigger.
use shellcheck as well so it will yell at you for being a tard ass.
wow literally zero source or explanation of what's being done here.
you're like that tard ass who points to like a shell script taking 30 seconds to process ~10,000 lines of shit but you have something like sed being called for simple transformations that can be done almost instantly with something like "${yourline/somememe/repl}"
we prefer frogs
lad you're abusing herestrings too much
first read line would probably be faster if you used <
Bash works perfectly on WSL.
>
>>What kind of hipster-ass distribution are you using that doesn't have bash as its default shell?
Whats wrong with portability
As long as its posix compliant who cares?
Also that isnt how you use greentext please dont misuse this feature as it is meant for quoting
Im surprised you havent gotten a reply of "who are you quoting" anyways have a good day friendo and stop bashing other peoples shell!!
t-teach me senpai
>writing programs for quick/temporary fixes and simple things where speed doesn't matter
Yeah, nah. I'll stick to a script. Scripts and programs both have their places, quit acting like one is always the answer. It's like saying fuck a backhoe, use a steamroller
modernperl.pdf. Its like super shell
I also use sh for my scripting.
What kind of reddit-ass faggot doesn't know how to greentext on Sup Forums?
Try doing this in Bash:
>year of 1974
>not scripting in lisp
excuse me?
I agree with OP, but imagine being so retarder you literally don't know when not to use bash
>I'll just add something to the command, that's all
>It's just a little regex
>now I just have to run a for loop
>it'll be perfect if I just...
>mapfile
shit no one needs
>arrays
I think they do exist in sh
>read splitting
shit no one needs
>basic paremeter expansions
shit no one needs
also tf dsl stand for
literally every *nix has bash preinstalled
Nope, the best distro doesn't have it.
That's literally false.
The world's most popular Linux distro doesn't even have bash
>case
>esac
How to become bash hacker?
Many embedded Unix systems don't have bash, like openwrt.
then you can easily install it or use real distros
See >It's nice to not need to install bash
Sure I could install it, but I'm not going to when sh works. Why would I plague my system with unnecessary GNU bloatware when I don't need to?
>use real distros
That's exactly what I'm doing.
Fixed some of it, I don't have bash 4.4 yet though.
Well I use python.
Also use it for programming.
Works pretty well. Fully cross platform etc.
Fixed some of it, I don't have bash 4.4 though
#!/bin/bash
tput civis
while :
do
mapfile -t toparray
bump
>My greentext skills are impeccable, tf you talking about?
>Hillbilly redneck tries to talk fancy
>throws in an extra "is".
$ file /bin/sh
/bin/sh is a symbolic link to dash
#!/bin/bash it is then.