Solved Creating a bash script

November 29, 2012 at 06:46:31
Specs: Windows xp and linux
hello,
i am trying to build an administrative bash script ehich collects contact information and writes to a file automaticlly.

the information which are required include:

full name
DOB
Gender
House addresse
Phone number
email address

Thank you


See More: Creating a bash script

Report •


#1
November 29, 2012 at 20:20:32
✔ Best Answer
The while loop contains only the full name. I'll leave it to you to include the rest of the variables:

#!/bin/bash

while true
do
   echo "enter fullname.  Press <enter> to quit"
   read fullname
   if [[ -z "$fullname" ]]
   then
      echo "quitting"
      exit 0
   fi
   echo "$fullname" >> file.txt
done


Report •

#2
November 30, 2012 at 09:40:06
thx NAILS,

It was really helpful.


Report •

Related Solutions


Ask Question