Skip to content

Commit

Permalink
src: Fixed no-word splitting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Venries committed Mar 19, 2017
1 parent 8e4e3ca commit 85589f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/xpub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ main () {
vterm="vt$(printf '%s' "${xtty}" | sed -e 's/tty//g')"

if [ -n "${xpids}" ]; then
for xpid in "${xpids}"; do
for xpid in ${xpids}; do
xdisplay="$(ps -o cmd= "${xpid}" | grep "${vterm}" | grep -E -o ':[0-9]')"
if [ "$?" -eq 0 ]; then
xdisplay="$(echo "${xdisplay}" | head -n1)"
Expand All @@ -92,8 +92,7 @@ main () {
exit 1
fi

for xway in "${xways}"; do
echo "${xway}"
for xway in ${xways}; do
if echo "${xway}" | grep -E "^${xtty}" > /dev/null ; then
xdisplay="$(echo "${xway}" | awk '{print $4}')"
break
Expand Down

0 comments on commit 85589f1

Please sign in to comment.