Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
1 vote
1 answer
335 views

Using variables for Ghostscript options/flags causes errors

I am scripting the creation/manipulation of PDF files so I am using gs (Ghostscript). The problem I am having is that if I use a variable for the the options, gs errors out. The command that I am ...
Allan's user avatar
  • 1,060
16 votes
3 answers
9k views

Loop over a string in zsh and Bash

I would like to convert this Bash loop: x="one two three" for i in ${x} do echo ${i} done in such a way to work with both Bash and zsh This solution works: x=( one two three ) for i in ${x[@...
antonio's user avatar
  • 1,463
8 votes
2 answers
3k views

Running commands stored in shell variables

The following works in my shell (zsh): > FOO='ls' > $FOO file1 file2 but the following doesn't: > FOO='emacs -nw' > $FOO zsh: command not found: emacs -nw even though invoking emacs -...
Amelio Vazquez-Reina's user avatar