We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 738f663 commit f487468Copy full SHA for f487468
systemd/system/codam-web-greeter-idler.sh
@@ -10,8 +10,9 @@ WHO_OUTPUT=$(/usr/bin/who)
10
while IFS= read -r line; do
11
# Get username
12
USERNAME=$(echo "$line" | awk '{print $1}')
13
- # Get display
14
- DISPLAY=$(echo "$line" | awk '{print $5}' | sed 's/[(|)]//g')
+ # Get display (everything between () and remove the ())
+ # Cannot use awk here to print a specific column because columns might contain spaces...
15
+ DISPLAY=$(echo "$line" | sed -n 's/.*(\(.*\))/\1/p')
16
# Go to next line if display does not start with :
17
if ! [[ "$DISPLAY" =~ ^: ]]; then
18
continue
0 commit comments