I am writing a bash shell script to display if a process is running or not.
So far, I got this:
printf \"%-50s %s\\n\" $PROC_NAME [UP]
echo -n "$PROC_NAME $(printf '\055%.0s' {1..40})" | head -c 40 ; echo -n " [UP]"
Explanation:
printf '\055%.0s' {1..40}
- Create 40 dashes"$PROC_NAME ..."
- Concatenate $PROC_NAME and dashes| head -c 40
- Trim string to first 40 chars