Commit f6cada7a authored by Peter Kovary's avatar Peter Kovary
Browse files

Add output $prefix

parent 0294df61
......@@ -74,8 +74,10 @@ if [[ -n "$1" ]]
fi
if [ "$all" = true ]; then
prefix=""
command_to_execute="who | grep '$username'"
else
prefix="Found "
command_to_execute="finger 2>/dev/null | tr -s ' ' | grep -E 'tty[7-9]|tty[[:digit:]]{2,}' | cut -d ' ' -f1-3 | grep -E -i '$username' "
fi
......@@ -87,7 +89,7 @@ function process_output {
if [ "$bare" = true ]; then
echo $host $found
else
echo "Found $found at $host"
echo "${prefix}${found} at ${host}"
fi
fi
else
......@@ -95,7 +97,7 @@ function process_output {
if [ "$bare" = true ]; then
echo $host $found
else
echo "Found $(echo $found | cut -d ' ' -f1) ($(echo $found | cut -d ' ' -f2-3)) at $host"
echo "${prefix}$(echo $found | cut -d ' ' -f1) ($(echo $found | cut -d ' ' -f2-3)) at $host"
fi
fi
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment