In a bash shell if a command is successful it returns 0, and if unsuccessful it returns a another number. How do I get the number returned?
For example, I want the return code number returned from the ls command
I try:
echo $ls
echo $(ls)
echo $(?ls)
But none give me what I am looking for. Any tips?