#!/bin/bash
echo "Enter process name"
read process
if pgrep "$process" > /dev/null
then
echo 0 $(awk '/Rss/ {print "+", $2}' /proc/`pidof $process`/smaps) | bc;
echo "Kb"
else
echo "Process $process not running"
fi
The output of the code above is
41250
Kb
and I need the "Kb" output in the same line as the number like this
41250 Kb