Validating "While read input"

Is there a way to validate input from a "while read" statement other than:

while read -r subdir; do
 if [ $subdir != "" ] ; then
894359Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
biraConnect With a Mentor Commented:
Is there a way to validate input from a "while read" statement other than:
-------------------------------------------------------

  i dont think so, unless you ensure that the file you
read has not nulls.
 
   while read -r subdir
      do
      echo $subdir
      done < inputfile
 
 
   
0
 
894359Author Commented:
What about while read -r subdir subdir2; do

Also!
0
All Courses

From novice to tech pro — start learning today.