[Bug 1100871] Re: BASH program output not functioning

a7x 1100871 at bugs.launchpad.net
Sat Jun 29 20:25:02 UTC 2013


wrong package (dash is the Debian Almquist Shell, not the Bourne-Again
Shell)

** Package changed: dash (Ubuntu) => bash (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1100871

Title:
  BASH program output not functioning

Status in “bash” package in Ubuntu:
  New

Bug description:
  Hello

  I have been battling this issue with BASH or w/e it is on this system.
  There are a lot of unexpected behaviours like ignoring -ux after
  #!/bin/bash -ux, I've had to "set -x". Also, I am unable to get the
  output from find to resolve as a variable in my loop which is
  effectively a running pipe. Back ticks and everything will not return
  output as I expect from BASH on Ubuntu 10 for example. Here is the
  script in its entirety:

  
  ### TOP OF SCRIPT ###
  #!/bin/bash 
  DOCUMENT_DIR=/var/lib/tomcat6/webapps/OscarDocument/
  MIN_ARGS=1
  NUMOFARGS=$#
  INPUTFILE=$1

  if [ "$NUMOFARGS" -lt "$MIN_ARGS" ]; then
  	echo "Missing file argument."
  	exit 1
  fi

  if [ ! -d "$DOCUMENT_DIR" ]; then
  	echo "Incorrect DOCUMENT DIR specified: $DOCUMENT_DIR"
  	exit 1
  fi

  if [ ! -f "$INPUTFILE" ]; then
  	echo "Incorrect file specified."
  	exit 1
  fi

  touch filesnotonFS.txt
  cat /dev/null > filesnotonFS.txt
  count=0
  cat $INPUTFILE | while read filename; do
  	if [ $(find $DOCUMENT_DIR -name "$filename" | wc -l) -eq 0 ]; then
  		echo "$filename" >> filesnotonFS.txt
  		count=$((count+1))
  		echo "\n$count files found" 
  	fi
  done
  ### END OF SCRIPT ###

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1100871/+subscriptions




More information about the foundations-bugs mailing list