I tried to assign the output of the command to a awkvariable:
USERS=$(awk '/\/X/ {print $1}' <(w))
This line is part of the following script:
#!/bin/sh
INTERFACE=$1
STATUS=$2
case "$STATUS" in
up)
if pidof dropbox; then
killall dropbox
fi
USERS=$(awk '/\/X/ {print $1}' <(w))
for user in $USERS; do
su -c "DISPLAY=$(awk '/\/X/ {print $11}' <(w)) dropboxd &" $user
done
;;
down)
;;
esac
However, I get the following error:
script: command substitution: line 14: syntax error near unexpected token `('
script: command substitution: line 14: `awk '/\/X/ {print $1}' <(w))'
All brackets are closed. Where is the syntax error?
source
share