Web lists-archives.com

Re: [Mingw-msys] Running .bat files




Hi All,
 
I am trying to display the file name and line number that is currently being executed in a bash file.
 
Test_Bash.sh contains
---------------------------------------------------------------------------------------------------------
#! /bin/sh
#
src_build()
{
  echo "Entering src_build"
  echo "BASH = " $BASH
  echo "LINENO = " $LINENO
  echo "COMP_LINE = " $COMP_LINE
  echo "BASH_SOURCE = " $BASH_SOURCE
  echo "BASH_COMMAND = " $BASH_COMMAND
  echo ${BASH_SOURCE[$i]}
  echo '${BASH_LINENO[$i]} = ' ${BASH_LINENO[$i]}
  echo "$i = " $i
  pwd
  ls
}
 
fail()
{
  echo
  echo "============="
  echo "fail         "
  echo "Build failed."
  echo "============="
  exit 1
}
 
succeed()
{
  echo
  echo "================"
  echo "Build succeeded."
  echo "================"
}
 
if src_build; then
  succeed
else
  echo "src_build fail"
  fail
fi
 
------------------------------------------------------------------------------------------------------------------
 
Part of the msys output is
 
GNUCash@ELSHADAI ~
$ Test_Bash.sh
Entering src_build
BASH =  /usr/bin/sh
LINENO =  3
COMP_LINE =
BASH_SOURCE =
BASH_COMMAND =
 
${BASH_LINENO[$i]} =
 =
/home/GNUCash
Packaging  Test_Bash.sh  src
 
================
Build succeeded.
================
 
How do I display the line number and filename of the currently executing bash file?
 
Thanks in advance for your help
 
Yours Sincerely Stephen Grant Brown
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys