All Questions
10
questions
0
votes
1
answer
73
views
zsh on MacOS catalina 10.15.17
I'm having a little trouble putting this all together...
I want to make a simple shell script to organize and sort around 60 GB worth of music and movie files that are spread out over 3 or for 4 ...
1
vote
0
answers
293
views
Source multiple files in background/parallel (ZSH)
For various reasons I would like to be able to source a series of files in background and wait for them all to finish:
source ./my_file_1.sh &
source ./my_file_2.sh &
...
# etc
wait
But, ...
1
vote
2
answers
2k
views
Change the default location of zsh completion cache files for macOS
I'm trying to change the default location of the zsh completion cache files in macOS. I have read the zsh documentation on completion which say's "alternatively, an explicit file name can be ...
1
vote
0
answers
54
views
$RANDOM, not so random [duplicate]
I want to print out a random number and encrypt it, like so: echo $RANDOM | sha256sum.
I would expect this to take the standard output of echo $RANDOM and pipe it into the encryption function. However ...
1
vote
2
answers
2k
views
Issue with running a shell script without using 'sh' on macOS Monterey
I'm new to shell scripting and generally the usage of Terminal.
I recently made a script.sh that I want to use by just typing its name without the full path.
So, I wrote the path of the directory into ...
2
votes
1
answer
3k
views
execute function in different shell
I usually zsh. I want to execute a function in bash and return back to my original shell. I can do this manually, but I want to automate it. How can I do that?
For example, I am on zsh.
I want to ...
0
votes
1
answer
456
views
Running nano from function in config file (function in zshrc) does not save changes
I am using zsh as my shell and I am trying to achieve this:
In my .zshrc file I want to have a function that modifies my .zshrc, saves it and reloads it.
So far I have to functions (in my .zshrc ...
2
votes
4
answers
1k
views
How to merge ls commands colors with the output of find or du?
I have a simple alias to list the size of files&folders in cwd.
( including dotfiles in this case , ignoring zero sizes )
du -sh .[!.]* * | sort -hr | grep -v '^0'
which can be achieved aswell ...
4
votes
1
answer
3k
views
Script-specific autocomplete in shell
I create a lot of little scripts to help me in my every day life.
I would like to provide auto-complete for them, specially that I intend to share them with people.
Now, I know I can create auto-...
23
votes
2
answers
9k
views
Writing shell scripts that will run on any shell (using multiple shebang lines?)
I've just started getting deeper into shell scripting, and I've always just thrown my script in a file, marked it chmod +x and then done /path/to/script.sh and let whatever interpreter is the default ...