Dash Is The Only Acceptable Symlink For /bin/sh

preview_player
Показать описание
==========Amazon Links==========

💖 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!

Today we're going to fix a very simple problem with Arch Linux and that is that for whatever reason /bin/sh is symlinked to Bash, I don't know why but it's really easy to fix it and change the symlink to something that actually makes sense like Dash.

==========Support The Channel==========

► BTC Wallet Address: 1Aokiv3pFQXUEmh2LbzZQAwxMvq6bpT2UN

► ETH Wallet Address: 0x80451867c86bdf08c3888d407c1e3fcb6add61ed

► LBC Wallet Address: bLRN9fm17sCexKfgbYqmMj5xskZF2ogpEh

=========Video Platforms==========

==========Social Media==========

==========Resources==========

==========My Repos==========

==========Credits==========
🎨 Channel Art:
All my art has was created by Supercozman

🎵 Ending music

DISCLOSURE: Wherever possible I use referral links, which means if you click one of the links in this video or description and make a purchase we may receive a small commission or other compensation.

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

For anyone saying that Bash will run in POSIX only mode when it's linked to sh, I don't know if it just doesn't work or I have something wrong with my install but I've had bashisms in those scripts. But anyway, are you on a distro that does this by default or are you on something like Arch where you have to fix it yourself, let me know down below.

BrodieRobertson
Автор

POSIX asks "What methods will work reliably, efficiently and correctly across the board?" OpenBSD asked the same question and gave us the new, cleaned-up ksh. I used to advocate dash but now, there's no need. Get loksh and learn easily with these two books:
Learning the Korn shell 2nd edition, Robbins and Rosenblatt
Korn shell programming by example, Dennis O'Brien

bashisobsolete.pythonismyn
Автор

I will be cleaning up my Arch distro, I had no idea it was setup like this. I appreciate the info.

henninb
Автор

I simply changed the symlink to dash on my fresh Artix install and it works perfectly. If I ever run into problems I'll just fix the offending script

FLMKane
Автор

I always think of the arguments in 'ln' command similar to the ones in 'mv'/'cp' command, that is, the first file is what you already have and the second is what you want to create. This way there is less chance to accidentally overwrite a non-link file.

luxucn
Автор

5:00 I imagine you can just live boot, mount the fs and pacstrap bash again.

Mpdarkguy
Автор

in gentoo there is a tool called "eselect sh" to manage the simlink of /bin/sh

FabioSantos-ypll
Автор

Dash is actually a bit more tolerant than pure POSIX. It includes the local keyword for scoping, for example.

Yash is stricter, I wouldn't try it with those warnings.

FantabulousNoise
Автор

4:20 "sudo !!" will run the last command as sudo ;)

Автор

thanks for this video, was just about to create a pacman hook for dash on my own.

zx
Автор

shellcheck is a bit better as it gives you suggestions to fix bashisms and can direct you to an explanation as to why to correct syntax

edvonrattlehead
Автор

I will suggest using a bare git repo instead of symlinking from your dotfiles directory

adammoussa
Автор

man bash:
"If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well."

itmanager
Автор

If your /bin/sh is Bash and you use #!/bin/sh shebang, then your script should be POSIX compatible without Bashisms.

wigust
Автор

Damn, 916 packages installed! I managed to do an installation with everything I wanted and stayed below 500. Maybe I can reduce even more
480


How much of that you think is required because of your college?

senninscorpion
Автор

I don't like dash, my important scripts have the strangest errors that don't exist when I use bash/zsh and I figure out why

BiologyIsHot
Автор

I have symlinked /bin/sh -> /usr/bin/node. Sorry, not sorry ;)

meru_lpz
Автор

man bash:
"If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well."

itmanager