Fix Your Shell Scripts With Shellcheck

  Рет қаралды 13,850

DistroTube

DistroTube

Күн бұрын

Shellcheck is a piece of free and open source software that gives warnings and suggestions for shell scripts. Using shellcheck, you can find errors earlier than you would otherwise. It's a tool that everyone that scripts should have in their toolbag.
REFERENCED:
► github.com/koalaman/shellcheck
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com/cgi-bin/webscr...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/stores/distrotube
SOCIAL PLATFORMS:
🗨️ Mastodon: distrotoot.com/@derek
💬 IRC: irc://freenode #distrotube
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/$/invite/@DistroTu...
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gemini Capsule: gemini://distro.tube
📁 GitLab: gitlab.com/dwt1
🔊 Audio Podcasts: www.buzzsprout.com/1263722
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Audacity: www.audacityteam.org/
💻 VirtualBox: www.virtualbox.org/
🗒️ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!

Пікірлер: 63
@fu_gyokuryu
@fu_gyokuryu 3 жыл бұрын
Weird world we live in, i found this today use it, and love it, and here it is DT doing a video on it
@littlepeon
@littlepeon 3 жыл бұрын
was expecting your shell example to start with shebang: #!/usr/local/bin/fish But then i realized Shellcheck would respond with error message: warning! Fish is NOT a shell!
@drishalballaney6590
@drishalballaney6590 3 жыл бұрын
HAHA I am dying 🤣🤣
@daringcuteseal
@daringcuteseal 3 жыл бұрын
loll
@alexkeenan2575
@alexkeenan2575 3 жыл бұрын
not sure if anyone gives a shit but if you are stoned like me during the covid times then you can watch pretty much all the new series on InstaFlixxer. Have been binge watching with my girlfriend for the last days =)
@jaceisaac7379
@jaceisaac7379 3 жыл бұрын
@Alex Keenan Definitely, I have been using instaflixxer for since november myself =)
@RickRomig
@RickRomig 3 жыл бұрын
I've been using shellcheck for at least a couple of years. I've set up aliases with the options and exclusions I use. A very handy utility.
@daxterstrock3319
@daxterstrock3319 3 жыл бұрын
Actually really excited too use this as I’m learning to write my own bash scripts and such
@martiniliev3021
@martiniliev3021 3 жыл бұрын
Thank you for this great utility, after checking with some scripts, I am impressed :)
@Gadgetoholic
@Gadgetoholic Жыл бұрын
Really helpful. Thanks man!
@kda_-uh3vj
@kda_-uh3vj 3 жыл бұрын
Amazing! I didn't know this existed
@rajughorai3909
@rajughorai3909 3 жыл бұрын
gone use next time i write shell code
@AtomToast
@AtomToast 3 жыл бұрын
you can also set up shellcheck with a diagnostics language server in order to get live linting right in your editor
@swindlesmccoop
@swindlesmccoop 2 жыл бұрын
do you know how i could set that up with vim?
@jm1981
@jm1981 3 жыл бұрын
Awesome stuff.
@AndersJackson
@AndersJackson 3 жыл бұрын
The XML format is great for interpreting the errors in automatic testing software. Like CodeGrade or something like that.
@zedth2
@zedth2 3 жыл бұрын
or integrating it into some sort of text editor IDE
@henninb
@henninb 3 жыл бұрын
This is one of my favorite tools
@sasharenee252
@sasharenee252 3 жыл бұрын
seems cool!
@YannMetalhead
@YannMetalhead Жыл бұрын
Good video.
@MarcelRobitaille
@MarcelRobitaille 3 жыл бұрын
If you walk so much about how much more efficient window managers / keyboard-driven everything is you may want to leave insert mode from time to time (your rice is pretty nice though. Love the green status line).
@edupazz
@edupazz 3 жыл бұрын
Great content, DT! Unfortunately, a downside of this application is it requires a ton of haskell dependencies (32, according to paru)
@DistroTube
@DistroTube 3 жыл бұрын
If you have XMonad and Pandoc installed anyway (and you really should), then it isn't a problem. ;)
@edupazz
@edupazz 3 жыл бұрын
@@DistroTube it's no my case, indeed
@BrucesWorldofStuff
@BrucesWorldofStuff 3 жыл бұрын
@@DistroTube HaHaHa I get 27 updates a day and 24 of them are Haskell updates and the sad thing. I don't remember why I have Haskell installed... LOL LLAP
@AndersJackson
@AndersJackson 3 жыл бұрын
@@BrucesWorldofStuff because you use Xmonad, of course. 😜
@BrucesWorldofStuff
@BrucesWorldofStuff 3 жыл бұрын
​@@AndersJackson LOL... That's the thing! I don't use Xmonad... ROTF I do use Leftwm and Spectrwm.... (Ding) Wait! Wait! Got it! Leftwm had me install Xmobar, Lemonbar, and Polybar. But I never Xmobar or Lemonbar. I used Polybar instead... LMAO... I bet that's it... LLAP
@guilherme5094
@guilherme5094 3 жыл бұрын
Nice!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
2:38 Perfectly valid code so far.
@SpencerA99
@SpencerA99 3 жыл бұрын
checkbashisms is another good one. Also has a posix flag. Written by debian I believe
@tusharkuntawar6170
@tusharkuntawar6170 3 жыл бұрын
Hey DT, do you know any stuff that makes navigation faster in vim without plugins
@mantamizhan4305
@mantamizhan4305 3 жыл бұрын
I would like know have you made terminal no-header ?
@aniakotowicz1976
@aniakotowicz1976 3 жыл бұрын
What are your thoughts on powershell core? 🤔
@007arek
@007arek 3 жыл бұрын
What is the best alternative to bash except python? I'm looking something for writing scripts.
@Neucher
@Neucher 3 жыл бұрын
DT, what will be the requirement for DT OS install script? Will it work on a fresh arch ?
@tazz7390
@tazz7390 3 жыл бұрын
Hey, DT, I have a question. How do you get menus for shutdown, restart and logout on window managers? I was using rofi before, but i3 doesn't seem to play well with rofi. Any suggestions?
@tic-tech-toe5394
@tic-tech-toe5394 3 жыл бұрын
you can use i3 menu to create custom menu for your likings. i am on i3 and i use that for shutdown and other custom shortcuts
@twb0109
@twb0109 3 жыл бұрын
Use i3 menus, they're like emacs keychords. Or write a shell script that outputs to rofi/dmenu, plenty of tutorials out there.
@tazz7390
@tazz7390 3 жыл бұрын
Thanks guys, I'll try that out!
@twb0109
@twb0109 3 жыл бұрын
@@tazz7390 you're welcome
@armynyus9123
@armynyus9123 3 жыл бұрын
I have that rather directly in the editor: bash-language-server
@lorenzocabrini
@lorenzocabrini 3 жыл бұрын
I tried LSP mode and must say I was less than satisfied. I much prefer to run a linter after a CTRL-x s, rather than having Emacs doing weird stuff while I'm writing code.
@armynyus9123
@armynyus9123 3 жыл бұрын
@@lorenzocabrini I hereby admit kind of ashamed, that for coding I'm still on vim => did not try LSP in emacs. But yes, linting only on save.
@lorenzocabrini
@lorenzocabrini 3 жыл бұрын
@@armynyus9123 No need to feel ashamed. Nothing wrong about vim. It's a very capable editor. You could have done a lot worse, like some javascript-based freakshow. Sometimes it may sound like I criticize vim, but I really don't. what gets me is this very vocal minority of vim "users" who, instead of being happy with their own editor, go onto videos about Emacs and demand that Emacs should be like vim. I for one celebrate the fact that we have two very capable editors to choose from, that way I can have it my way and you can have it your way. I used a vi-clone called elvis for many years, so I'm quite familiar with vi keybindings. It's just that I personally prefer the Emacs ones, not because I think they are superior but merely because I'm really used to them for my everyday tasks.
@ricknaam5658
@ricknaam5658 3 жыл бұрын
I never knew this worked in emacs (just install flycheck and shellcheck, no config needed), Ive been copy/pasting into the website this whole time..
@AndersJackson
@AndersJackson 3 жыл бұрын
Hm, have to check that out.
@auronkardek
@auronkardek 3 жыл бұрын
I gonna disable this double quote error really fast
@phyzix_phyzix
@phyzix_phyzix 3 жыл бұрын
I was telling someone about this today. Nice coincidence
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
5:06 Not necessarily an error; it might be what you want.
3 жыл бұрын
Hey DT! I made a comment which made reference to a shell script I wrote which is called "bench.sh" and that comment is gone. Did it go to spam, or did you actually delete it? I did not write anything which would warrant deletion --- however warrant or not, its ultimately you who decides what types of comments you want. At any rate, I have always been decent AFAIK so I'm perplexed as to why it was deleted. Greetings from Scandinavia! Have a fantastic day.
@DistroTube
@DistroTube 3 жыл бұрын
Many comments get caught up in KZbin's spam algorithms. I don't see a comment from you in "Held for review". KZbin might have just deleted it entirely. Not much I or anyone else can do about this. It's just KZbin being KZbin.
3 жыл бұрын
​@@DistroTube I wrote a fairly long reply to yours just now and that too was deleted or "lost", unfortunately I had not copied and pasted the text into a texteditor as I normally do as a "security measure" or as a time saving effort when writing longer replies -- because the browser could crash and there goes the reply. So I have found myself automatically writing most of my comments in a texteditor simply to save myself time. But of course that does not rectify/fix anything when it comes to how YT handles comments -- its kind of just for my own sanity or peace of mind, because a guy's time is valuable as you probably already know very werll. At any rate, keep up the great content. I enjoy it all. 🙂
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
3:38 Obvious problem at this point is the missing shebang line.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
2:44 No such variable -- only error I can see so far.
@lakromani8172
@lakromani8172 2 жыл бұрын
Why does not shellcheck complain about the $sayHello? Line should be echo "$sayHello $myName"
Want A List Of Your Keybindings? Write A Shell Script!
27:11
DistroTube
Рет қаралды 24 М.
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 30 МЛН
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 20 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 11 МЛН
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
How To Use The Shell Commands 'pushd', 'popd' and 'dirs'
13:45
DistroTube
Рет қаралды 16 М.
Two Powerful Command Line Utilities 'cut' And 'tr'
15:18
DistroTube
Рет қаралды 32 М.
BASH scripting will change your life
14:18
NetworkChuck
Рет қаралды 1 МЛН
Create BULLET PROOF Shell Scripts with ShellCheck and Neovim!
5:54
DevOps Toolbox
Рет қаралды 11 М.
How To Access Any Forked GitHub Repositories Data
9:31
Mental Outlaw
Рет қаралды 36 М.
Solve Problems With Shell Scripting And Dmenu
18:26
DistroTube
Рет қаралды 32 М.
What Are Linux Users Putting In Their Config Files?
31:47
DistroTube
Рет қаралды 92 М.
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 97 М.
EVERYONE Needs to Learn a Little Bit of AWK!
16:29
Gary Explains
Рет қаралды 396 М.
Cheapest gaming phone? 🤭 #miniphone #smartphone #iphone #fy
0:19
Pockify™
Рет қаралды 4,3 МЛН
ЕС урезает аккумуляторы 🪫
1:00
Не шарю!
Рет қаралды 143 М.
Худшие кожаные чехлы для iPhone
1:00
Rozetked
Рет қаралды 1,7 МЛН
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 1,2 МЛН