Skip to content

Tag: zsh

Possible to combine glob sort w/ alternation in zsh?

Looking for a shell-only[1] way to take this list of dirs: And return it sorted numerically, with the subdirs showing up right after their parent: (*|*/bar)(n) is rejected as a bad pattern, while */{,bar}(n) expands to */(n) ~/bar(n) so the subdirs show up at the end. [1] I need this to be able to work on a w…

Obtaining file names from directory in Bash

I am trying to create a zsh script to test my project. The teacher supplied us with some input files and expected output files. I need to diff the output files from myExecutable with the expected output files. Question: Does $iF contain a string in the following code or some kind of bash reference to the file…

bash command not found when setting a variable

I am writing a shell script where I am setting few variables, whose value is the output of commands. The errors I get are: now, I did read other similar questions and based on it, I tried various things: spliting command into two calls tried using backticks tried using $() But in every case the command output…

SSH – Entering a Passphrase Only Once

On $ ssh localhost, I was being asked to provide password. It was tedious and kind of annoying to provide password for every login. So, I have created ssh keys with passphrase.. I have copied the content of the ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys Now, on $ ssh localhost I was being asked to provide pa…