I am trying to improve my bash knowledge as well as make my code more organized
What I am trying to do here is add the flag -u with the variable $user only if the variable exist otherwise don't mention the -u flag.
Here is what I tried to do
echo "Running: ps if [[ -n "$user"]]; then -u $user fi | wc -l"
If $user exist is it will print the amount of proccesses $user has
however if $user does not exist just show the amount of proccesses of all users
Important to note that I need it to be this way (inside the echo)