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]
If you are ending the pad characters at some fixed column number, then you can overpad and cut to length:
# Previously defined:
# PROC_NAME
# PROC_STATUS
PAD="--------------------------------------------------"
LINE=$(printf "%s %s" "$PROC_NAME" "$PAD" | cut -c 1-${#PAD})
printf "%s %s\n" "$LINE" "$PROC_STATUS"