July 15, 2008

return codes in bash

Totally forgot how to get the return codes from bash

after a few seconds I got a small test working

#!/bin/bash

BAR=”ls -l dfjkh “
$BAR
RET=$?
echo $RET

other codes

$? return status

$$ shell’s pid

$- last asynchronous executed program’s pid