For debugging bash scripts I use

set -o xtrace # long form of -x
set -o pipefail
set -o errexit

# print file, line number and function name while tracing
PS4='+ $(echo -en "\\033[1;36m`basename "$0"`:$LINENO $FUNCNAME()\033[0m ")'




On Mon, Apr 8, 2013 at 10:32 AM, Erez D <[email protected]> wrote:

> to debug a shell script i can run it as 'sh -x myscript'
> but how can i enable the debug from within the script if run with 'sh
> myscript' ?
>
> thanks,
> erez.
>
> _______________________________________________
> Linux-il mailing list
> [email protected]
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
>


-- 
Constantine Shulyupin
http://www.MakeLinux.co.il/
Embedded Linux Systems
Tel Aviv
_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to