Saturday, 22 November 2008

bash echo on

I've searched previously for a way to echo all the commands in a bash script.
Today i found it on a asp page of all places:

set -o verbose #echo on
set +o verbose #echo off


If you want to do it once to debug a script you can also do:
bash -x your_script.sh

2 comments:

  1. Verbose is for verbose. Try these for echo:
    set -x #echo on
    set +x #echo off

    ReplyDelete
  2. If you're looking for a way to fix your bash not echoing your typed characters after broken exit from a password entry, vim, etc.:

    stty echo

    HTH
    David

    ReplyDelete