Tagged Questions
2
votes
2answers
95 views
/usr/bin/env: zsh -: No such file or directory
I get the error
/usr/bin/env: zsh -: No such file or directory
...when I run an executable zsh script that starts with the following shebang line:
#!/usr/bin/env zsh -
Also, FWIW, replacing - ...
5
votes
4answers
136 views
Hybrid code in shell scripts. Sharing variables
This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is ...
1
vote
1answer
86 views
Frequent command “template”: remove parameter expansion escape characters
zsh newbie here... I find myself using a handful of long commands over and over again with slightly different arguments. For example:
rsync -havu --progress --rsh='ssh -l mylogin' ...
3
votes
3answers
243 views
Converting a history to a script?
Often times I've typed in a bunch of commands when I realize that I am going to keep typing them in and that I would really like a script.
Now I understand that no matter how I save my history, I am ...
6
votes
2answers
914 views
List elements with spaces in zsh
I've been studying zsh scripting for all of 2 hours at this point and I've hit a wall. I want to go through a list of files that may have spaces in them. I'm open to completely different approaches ...
1
vote
1answer
137 views
How to access user's fpath as opposed to system's fpath with a script?
test.zsh:
#!/usr/bin/env zsh
for f in ${fpath}; do
echo ${f}
done
outputs:
...