I am following the installation instructions from this article but I get a bad substitution error from zsh when executing this command: What am I supposed to change for zsh? Answer ${DISTRIB_ID,,} is a Bash-specific parameter expansion to lowercase the value of the variable. https://askubuntu.com/a/383360/25077 suggests ${(L)DISTRIB_ID} as a corresponding operation in Zsh. But there is no real reason for
Tag: zsh
Open tabs in Windows Terminal w/ Ubuntu WSL & Zsh
I’m writing a script to run on UBUNTU WSL in Windows. I use zsh as my shell, but bash could work too here. I’d like that bash script to use wt.exe (Windows Terminal) to open some new tabs. Here’s what I have so far: You’ll need Windows 10 w/ Ubuntu WSL and Windows Terminal for that to work. This bash
Backslash inside an alias not being stored as part of its definition
I’ve got a screen sessions named BedrockServer. I’ve entered the alias like this: But when I type alias, it lists it as and the alias doesn’t work. I’ve tried messing around with the quotes and using backslashes before the quotes and before the dollar sign, but nothing fixes it. Any ideas what I’m doing wrong? Answer Inside single quotes all
Escaping Backslashes and Double Quotes in zsh Alias
I am trying to create an alias that should turn into the following command: It’s straightforward to just do on bash, but on zsh, the command turns into I can’t get the ” or the to escape. Answer It looks like you’re treating the first and last double-quotes as ‘surrounding’ quotes for the entire expression, but that’s not how
Tryinf to run existing scripts in shell gives “command not found”
I am trying to install Anaconda with a sh script. I am using Ubuntu 18. Here is my Downloads folder. We can clearly see the script But running it gives a “command not found”. What could be the issue? Answer You can see from the permissions -rw-rw-r– that it is not executable. If you do: then you should see the
why “mpv $(ls video *)” is not the same as “mpv video *”? (pls help noobie to work with shell)
So, the problem is – I have a list of files and I want to send them into a program, so it could handle this list in the same process. What I mean is, for example I have a bunch video files, that I want to play with mpv, but I need to pass them into a certain order which
Bash export variables but only for current command
I want to load some environment variables from a file before running a node script, so that the script has access to them. However, I don’t want the environment variables to be set in my shell after the script is done executing. I can load the environment variables like this: However, after the command is run, all of the environment
mixing process substitution and pipes in zsh
Using ZSH, I am trying to wrap a sed command into a function, then use it, while mixing pipes with process substution. Let me explain with an example: As you can see, in those 2 out of those 3 usages work. The last one is the one that intrigues me here. (Note that all commands work with bash) Can you
Why does zsh not autocomplete custom created scripts when bash does?
I have a custom created script to change my apt sources in /home/USERNAME/Scripts. I have added this path to the secure_path variable in /etc/sudoers. When I use bash to run my script as sudo it autocompletes just fine, but when using zsh it does not. Answer Because zsh doesn’t have autocompletion without adding it to .zshrc. Look for a good
Why do write syscalls print `%` at end on linux x86_64 (nasm)?
The following hello-world program displays a % sign at the end of the printed string. Why is this and how can I remove it? Here is my program: And here is the output when I run the executable: hello, world!% Thanks in advance. Edit: It seems to be caused by zsh (not reproducible in bash). The question is why this