Having been in this situation (the only binary I could use was
bash
, althoughcd
was a bash builtin for me),echo *
is your friend. Even better is something like this:get_path_type() { local item item="$1" [[ -z "$item" ]] && { echo 'wrong arg count passed to get_path_type'; return 1; } if [[ -d "$item" ]]; then echo 'dir' elif [[ -f "$item" ]]; then echo 'file' elif [[ -h "$item" ]]; then echo 'link' # not accurate, but symlink is too long else echo '????' fi } print_path_listing() { local path path_type path="$1" [[ -z "$path" ]] && { echo 'wrong arg count passed to print_path_listing'; return 1; } path_type="$(get_path_type "$path")" printf '%s\t%s\n' "$path_type" "$path" } ls() { local path paths item symlink_regex paths=("$@") if ((${#paths[@]} == 0)); then paths=("$(pwd)") fi shopt -s dotglob for path in "${paths[@]}"; do if [[ -d "$path" ]]; then printf '%s\n' "$path" for item in "$path"/*; do print_path_listing "$item" done elif [[ -e "$path" ]]; then print_path_listing "$path" printf '\n' fi done }
This is recreated from memory and will likely have several nasty bugs. I also wrote it and quickly tested it entirely on my phone which was a bit painful. It should be pure bash, so it’ll work in this type of situation.
EDIT: I’m bored and sleep deprived and wanted to do something, hence this nonsense. I’ve taken the joke entirely too seriously.
I wanted to try it on my phone to, since I’m bored sitting on my train to work, but appearently you can’t copy text out of jeroba and now I don’t care enough to open it in my webbrowser
FWIW - starting a reply allows you to copy the original text.
TIL
Also if you tap on the ‘kebab’ menu and press
View Source
, you can copy the message.
… but
cd
is a built-in-1 accuracy point ( ◞ ﹏ ◟)
linux 4.5-rc5 had efivarfs fixed to prevent “rm -rf /” bricking uefi motherboards – so maybe someone can try it out? :]
This is one of the reasons I’ve disabled uefi by default with the
noefi
kernel parameter, the other reason being the LogoFAIL exploit: https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Disable_UEFI_variable_access
Reminds me this great story from a different era:
That was a beautiful read, cheers!
If you enjoyed it, I’ve collected a couple of others:
The final line of the one about the VAX machine is so perfect
THANKS!!! I have it bookmarked forever now!
I lost access to it. Thank you for bringing it back to me! Yay!..
I got reminded of it last week after years. What are the chances it came up again. 😁
Hmmm command not found, let me just try the same command a couple more times, this time it will work right?
In IT teaching users to actually read and understand errors is always an uphill battle.
Tbh I’d try it multiple times too, just because the concept of cd not being there is horrifying and cannot possibly be the case
Very true, I would do the same and feel my stomach drop farther each time.
Also muscle memory. I keep typing aliases I only have on my computer :(
I learned early in my software engineering career these two beautiful rules of debugging:
- Read all of the words
- Believe them
Unless you were the one writing the program and its error messages - then check, that you didn’t mess up there…
Until you write a compiler error in some deeply templated C++ code, in which case just reading every word takes all day
/s but not too much
Addendum to 2: never believe that what they say is relevant to what’s actually happening here. You have a lot of faith that the people writing error messages knew what they were doing!
Having written some error messages in a godforsaken database frontend, an error message only means that something didn’t work correctly and may or may not correctly indicate what is actually wrong
I mean, if the error says “variable foo is not defined” I don’t think it’s wise to go “I’m pretty sure it’s defined, the compiler is just wrong” 😂
I don’t know, have you ever used JavaScript? I’ve run into some really fucking weird bugs. I’ve also spent hours trying to find the source of an error message only to discover the error message was lying and caused by some other error.
You see they all different one use / the other use - and ~
/S
Never dealt with an intermittent failure or race condition, eh?
Where is the Windows ‘help’ button, did you try that?
“gg” - dd
bah, https://github.com/fosslinux/live-bootstrap
you don’t even need a terminal or a prompt to bootstrap every tool you need.
I see girls last tour, I upvote.
echo $PATH
And
alias
to be sure.bash: echo: command not found
bash: alias: command not found
echo
andalias
are both shell commands. If the shell is running (which it obviously still is), those commands should still work, as it does not involve reading data from disk, but from memory.Edit: I just noticed the picture said
cd
was not found, which is also a shell built-in. So, I don’t know.Just tested it in a container. The original screenshot is wrong:
Why would somebody lie on the internet?
(╯°□°)╯︵ ┻━┻
Switch your calculator with a computer. Try again.
Empty
$PATH
.sudo dd if=. /rpi3-aarch64-archlinux.img status=progress of=/dev/sd[tab] [tab] [enter]
I remember being so scared the first time I screwed up my
$PATH
This isn’t programming, just someone who sucks at bash.
How else are you going to open your files in nano to do the programming on the prod server?
what’s a nano?
A metric prefix that represents 10e-9 of a unit.
The beginner (and better) version of vim?
guix rollback