If you run
echo "$((v))"
and v is a user supplied variable.
If the user put a specific string in v, he can execute whatever he wants
in the name of the script, because echo "$((v))" will run that code.
Am 6/4/2019 um 4:29 PM schrieb Chet Ramey:
On 6/4/19 7:42 AM, Nils Em
ntext is unsafe.
Repeat-By:
If this is considered a bug I would like to get in contact with
someone in charge.
--
Nils Emmerich
ERNW Research GmbH
Carl-Bosch-Str. 4
69115 Heidelberg
www.ernw.de
Tel. +49 6221 480390 (Sekretariat)
Handelsregister Mannheim HRB 723285
Geschäftsführer: Dr
On 19 Okt., 02:56, Chet Ramey wrote:
> Second, there are a couple of problems with Posix and this construct.
> You can make an argument that Posix doesn't apply, since it only
> calls for parameter expansion on the value of PS1, and that does not
> include command substitution. Even if it does ap
PS1='$( [ "${LOGNAME}" != root ] && color=green )'
works in ksh93 and POSIX shell but fails in bash as bash seems to
expand the "!" to the next history file number before doing command
substitution. Setting PS1='$( [ "${LOGNAME}" !!= root ] &&
color=green )' preserves the "!" and works in bash but
I use a shared .profile for bash and ksh93, I have a ksh93 specific
section which I want to separate through the following construct:
if ( test -n "${.sh.version}" ) 2>/dev/null; then
echo "ksh"
fi
bash just hangs while it works in POSIX shell and ksh93. A bash script
with above contents also
On 16 Okt., 21:18, Chet Ramey wrote:
> Sort of. I think you're overlooking the various expansion (and backslash
> escaping) that's taking place with your prompt.
>
> Since you set the value of PS1 to literal string containing a command
> substitution, the value will be expanded twice before being
I'm using bash 3.2 and I'd like to set my prompt to the following
(inspired by the Opensolaris prompt for ksh93):
PS1='$(
spwd="${PWD/#${HOME}/~}"
[[ ${#spwd} -gt 10 ]] && spwd="...${spwd: -10}"
printf "%...@%s:%s%s " "\u" "\h" "${spwd}" "\$"
termtitle="\...@\h:${spwd}"