Shell Script Tutorial: A Look At Posix Compliant Shell Operators

preview_player
Показать описание
One of the first mistakes that new users of any Unix based system like Linux, Unix or MacOS do when scripting is writing all of their scripts within bash script. This is always a problem however it is when you want to migrate to a shell that doesn't support bash syntax and that's where posix compliance comes into play. Today I specifically take a look at the posix comparion operators and the boolean operators, there are also file operators but these are much more rarely used.

💖 Subscribe and ding the bell for more videos!
👍 Leave a like if you got something out of this video!
✍ Comment some video feedback or what you want to see next time!

==========Support The Channel==========
Patreon:

Paypal:

BTC Wallet Address:
1Aokiv3pFQXUEmh2LbzZQAwxMvq6bpT2UN

ETH Wallet Address:
0x80451867c86bdf08c3888d407c1e3fcb6add61ed

LBC Wallet Address:
bLRN9fm17sCexKfgbYqmMj5xskZF2ogpEh

==========My Links==========
LBRY Referral:

🎥 LBRY:

Discord:

🐦 Twitter:

🌐 Mastodon:

🖥️ GitHub:

==========Credits==========
🎵 Opening music
Creative Commons — Attribution 3.0 Unported — CC BY 3.0

🎵 Ending music
Рекомендации по теме
Комментарии
Автор

I like to write every script with posix compliance in mind if you do as well let me know why you do it, or if you don't and you openly embrace zsh, bash etc. let me know why do that as well down below.

BrodieRobertson
Автор

A suggestion for your presentation, Brodie. Start with the general stuff. In your case - why is this important or what's the value of being POSIX compliant. The way you do it after 10 min of specific demonstrations, honestly a man who doesn't know about POSIX compliance and why is it a thing will be dropping out of the presentation. Just put your main thoughts and goals upfront and then drill down to the specifics. Doing it the other way around is just messy for people.

chonkov
Автор

Zoom your videos please, I usually watch on mobile

a_maxed_out_handle_of__chars
Автор

I don't see any point in POSIX compliant shell scripting. It's hard to find an OS that doesn't have either bash or zsh but does have POSIX sh in 2020. Since I'm running zsh interactively anyway, I can also use its syntax to make shell scripts look a little less horrible. POSIX purity is a pointless excercise to me. What I do find good practices though is to stick to shell functionality instead of loads of external processes like head, cat, ...
Good video anyway. Thumbs up!

XaverHellauer