NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Cooless with feh
Date: Mon, 14 Sep 2026 15:37:33 -0400
From: Todd Gruhn <tgruhn2%gmail.com@localhost>
Message-ID: <CA+9Akf-ZAosh9yJBnydMH=wRESA6ojGeC7iYUiM2LPTn9T=ECQ%mail.gmail.com@localhost>
| What does " sh -ec ' " mean?
| I am assuming "/bin/sh -ec ' "
Yes, for the assumption. Any Bourne shell type shell (bash, dask, ksh93,
yash...) should work for this, just as well as /bin/sh though.
It means run the shell with the -e (which you don't really want) and -c
options. The ' that follows introduces the script that is run, it
continues up to the next '.
Al alternative way to do it would be to put everything from (not including)
the initial ' up to (again, not including) the final ' into a file, and
then run
sh file
The -c option tells sh to run the first non-option arg as a script given
on the command line, usually it would be something very simple, like
sh -c 'echo foo'
but the script that is there can be as long as you want - you just need
to be careful if it needs any 'quoted text' or $'C-style quoted text' in
it, as the first ' it sees after the opening one will be the closing quote,
even if it was intended to be a nested opening quote (those just don't work),,
If there is no -c then the first non-option arg to sh is the name of a file
of commands to run (there are other possibilities, but these two, along with
the simple case where there is no non-option arg, and no -c either, which
is just starting an interactive sh).
If your login shell is csh (or one of its variants) using a multi-line
quoted string as an arg, the way it was done here, probably won't work.
In that case, put the string in a file, and run "sh file" instead (usually
you'd give the full path to the file name, so you can run the same command
from anywhere, not just the directory you are currently in).
kre
Home |
Main Index |
Thread Index |
Old Index