Bash General

Why aren't you writing more Bash code???

Attached: 2019-03-31-090000_1600x900_scrot.png (1600x900, 622K)

Other urls found in this thread:

docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6
twitter.com/SFWRedditGifs

>scripting
>code
Bash is useful, but in the field of cs, there are far more interesting things to do than systems administration. Also, I bet most of your "code" is spaghetti.

Mostly because I don't have a demand for more.
I already use it as much as I currently think is possible.

Because I'm not a faggot or a poorfag that uses Linshit

I write my console applications with PHP. Because classes > spaghetto code

Oh but I am :)

because it's a poor tool even for what it was designed for
enjoy your string expansion bugs

but you are

Because the syntax is fucking cancerous
if [ ! EXPR ]
then
echo "what the fuck"
fi

If you forget those spaces around ! it doesnt work wtf

cat /tmp/covers.txt | while read LINE; do wget $LINE; done

did this recently to download images online

if [[ ! EXPR ]]; then
echo "Nobody writes if statements like that."
echo "Also, [ is POSIX syntax, not bash."
fi

All I write is bash since it's easy and I'm lazy.

You're much worse than that, yes. But you're still a faggot

because i'm using rc.

DESCRIPTION
rc is a command interpreter and programming language similar to sh(1).
It is based on the AT&T Plan 9 shell of the same name. The shell
offers a C-like syntax (much more so than the C shell), and a powerful
mechanism for manipulating variables. It is reasonably small and rea‐
sonably fast, especially when compared to contemporary shells. Its use
is intended to be interactive, but the language lends itself well to
scripts.

Bash is the most hideous scripting language to ever exist and I fucking wish POSIX would throw out sh and get something that's not shit instead.

"[" is a short way to write "test", that's why you need spaces.
Source: man bash, man test
Ps: correct syntax in bash is "[[...]]"

>syntax
it really is ass. Who the shit came up with this bullshit?

Attached: Bad+bad+monkey+_44377dfe45762cb3bc525d3f51732c7a.jpg (466x348, 22K)

install rc

If your bash script has more than 2 if statements it’s time to switch to python.

If you have to stick with bash, at least use the shellcheck linter.

I've written a lot of BASH but I avoid it when I can. The syntax is disgusting

You mean GNUshit. Linux is a kernel.

remove the cat file
add done < file

also wget can read URLs from file

I'm very bad at it and I dont want people to Bash me B)

Rc is way better than bash. Most of the gnu stuff is trash

Wish I could stand the retard made GUI of linux's DEs. Windows just works, it's snappy, there's no blur.

I write my scripts in js and python because they're more modern

>poorfag
imagine having a life where all your choices are dependent on your insecurities.
>$2k facebook browsing shitbox
>windows

>$20mil supercomputer
>linux

I write too much bash code. I need to fix myself.

bash is featureful enough that you can do an uncomfortable amount of main processing and logic with it, and your main issues will be speed and bash's nasty syntax
I should just use a different shell language, but bash is installed on damn near everything and if I'm writing in it, I'm already being a lazy shit

IFS=

done
would be nice if bash offered a no legacy mode that disabled most of the bullshit misfeatures it inherited from sh

bash isn't sh

both of them are 29 and 23 years old respectively.
what other kind of shit do you have as excuses?

because most of it's python

>excuses
nigger It's literally faster. I have written bash scripts too

Here POSIX mastercode:
[ ! EXPR ] && echo "wtf"


When someone says "bash" there's a big chance that it's due to ignorance and they just want to mean "shell script".

posix is cuckolding
why would you care that your script runs on macos or other shitsystems

>Why aren't you writing more Bash code???
Because I'm writing POSIX sh code instead

Attached: 1553613790240.gif (5x7, 4K)

even macos ships with bash

because bash syntax is fucking ass

Because python, user.

Anything I can use that uses java syntax?

retard

Is fish superior, is it worth learning?

Why? Why should I use shitty bashisms to do stuff that can equally well be done by any POSIX-compatible shell?

I love bash for its speed and ease of use,
but it becomes very hard to maintain after few lines of code, that's why I now use Python to automate almost anything

Attached: c07d34eb801cebfbfb87a2ec799f1b2c.jpg (640x640, 105K)

>not using zsh

Attached: 85983b236339a3dfa6e25a0defbd7993.jpg (500x375, 45K)

>zsh
back to the reddit

>I love readline
>what's visual mode?
>emacs by default yeah!!!
>my pinky hurts

I have to take the time to learn it, but the syntax seems to be awful.

powershell core though.

Attached: Screenshot 2019-03-31 at 17.35.44.png (964x1200, 1.4M)

UNIX creators did
Because POSIX is shit. Abandon it.

For automating terminal stuff, Bash is infinitely better than Pyshit

HNNNNNGH!!

Ruby scripts require at most 1/3rd the code, often less. Get with the times.

because I write it in JavaScript if its more than 5 lines, otherwise I write a fish function

Attached: Screenshot from 2019-03-31 18-07-56.png (590x318, 27K)

This is garbage advice. If you're doing things that mostly hook together existing commands just wrapping what you're doing in subprocess or os.system does not magically make it better. In fact often it's worse. Now you have to execve() another interpreter.

Fucking pythonfags.

Old as fuck bash because Apple can't into GPLv3. Enjoy your lack of patches.

It's completely not worth learning. However, you should do whatever you want to do.

Just don't expect to go work somewhere and use that shit.

>spinning up V8 to automate things on the CLI

Jesus fuck jsfags are retarded.

>UNIX creators did
wow, what a bunch of mongrels

>Because POSIX is shit. Abandon it.
I can see the logic behind that but bash is just the same POSIX, except with additional even worse shit tacked on top.
POSIX shell is at least portable and available pretty much everywhere and doesn't require starting additional runtimes, which is something neither bash nor any other language like python can claim. Perl and python do come close because almost everyone has these, but the keyword is almost, whereas pretty much absolutely everyone does have some POSIX-compatible shell.

What's the point in learning a bunch of cryptic commands when you can just click your way through the task or write a Python script? Enjoy your shell script breaking every six months and working on only one OS.

>have shell scripts that have worked for over a decade

Okay macfag.

>taking screenshots of images instead of saving images
what happened to the internet

Attached: 1554049242224.jpg (864x1080, 110K)

normies

Macfag and proud.

Attached: 4e557673934eae6f847dec6ec241e7aa.jpg (1920x1200, 113K)

Too bad your ability to overpay for underpowered shiny hardware hasn't given you the ability to write software that is useful and lasts for years.

That's what I use Python for, and I can run it on Windows too.

Attached: Captura de Tela 2019-03-31 às 13.53.50.png (842x564, 86K)

> Powershell
> Windows
Nope, sorry

Attached: d9a3cec4a82631b2fc809e94aed4cd65.jpg (750x750, 111K)

Fuck off jordan

>script breaking every six months
that's Python

How much money does it cost to bust a nut on this whore's tits?

Not always.
Try to write a web scrapper or a browser automation script in bash and come back here to post your code.

Attached: 2f2b803f590a8e985cafa7099a37fa17.jpg (1080x1350, 151K)

man wget

Quit posting ugly roasties. Go back to /b/.

Judging by her ceiling chandelier, a lot.
Only the top 0.01% richest Alpha males on the planet can pretend to nurture women this hot.
Just look at Nick Bateman on instagram (pic related, it's him). How can we be happy when guys like this exist ?

Sorry user, but we'll probably never be one of them. We're just poor autistic geeks shitposting here all day, and we're probably ugly.

Ho, and btw, use Python, otherwise your bash scripts will quickly become a mess.

Attached: a4eeb5703fc1c4594bb3cd1e7a9608f5.jpg (1080x1080, 136K)

> man wget
Are you this autistic ?
I said a web scrapper, not a single url fetcher.

Fuck, almost made me cry, but you are right.

Attached: 961cd87762f55df70e63d42a676f9aaf.png (581x1100, 794K)

Go whine about being an incel on 8 chan. We're talking about shell scripting here faggot.

ur retarded

would you please stop posting badly cropped screenshots of pictures

The true power of a python brainlet.

Wrote an installation script for my environment today so I never have to set it up manually again, wish I would have done this years ago.

>If your bash script has more than 2 if statements it’s time to switch to python.
Personally I draw the line after 500 lines of code.

b- but i do

Says the Chrome shit tripfag

>not using php for everything
>not running apache locally to expose system functionality to a browser
take the naked pill, anons. security is an unwinnable rat race.

Any tips for a Linux beginner to get into scripting? I've configured my entire system but automating it with shell scripts seems a bit tough without Googling everything.

rate

sed -e "/./ =" $@ | sed -e '/./ { s/^/ /; N; s/^ *\(......\)\n/\1 /; }'

#!/usr/bin/env bash

set -e

links=( $( wget "$@" -qo /dev/null -SO - | grep -oE '

Milk truck just arrived

made a little mistake there but you get it

Cao Nikola

Why do people even use bash in $CURRENT_YEAR?

>interactive shells
zsh, fish
>scripting tools
plain sh, Perl, Python, Ruby, a thousand other full-featured scripting languages

bash was a handy tool in early GNU days, but now it's a shitty middle ground. The extra scripting features aren't needed anymore and it lacks the usability and features of a modern shell (and the extra bloat is a non-issue on literally any device made in the last decade).

Attached: why does this turn me on.png (128x128, 9K)

> Not using powershell in Linux.

docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6

Sorry user, the game's over.

Do I even want to know why this exists?

Based and redpilled.
Python and incels win.

This example is still simple, and yet it's almost beginning to turn into a big pile of unmaintainable code.
But if you decide to be autistic until the end, way to go.

Attached: a4ecfc45958ed9ade40a67cb3b8545a2.jpg (634x2662, 436K)

Master level

Attached: 1553884366440.png (600x563, 80K)

based

you don't understand basics of a language
you should not write a code in any language without learning it properly first, string interpolation/evaluation rules are the basics!
people blame the shell when they are just too stupid to understand that syntax is not the only thing that varies beetween languages
you should not expect every language to act the same, they serve different purposes and were constructed in a way to aid the user in solving the particular set of problems

linux is a kernel