sid22
May 3, 2011, 3:25pm
1
Hi,
while [ 1 -eq 1 ]; do
echo "Please enter "
read enter
yyyy=${enter:0:4}
mm=${enter:5:2}
dd=${enter:8:2}
result=`validateDate $yyyy $mm $dd`
When does the loop keeping repeating till?? till 1 is equal to 1?
what does this mean "${enter:0:4}" .The 0 and 4 part??
What does IFS do?? so if its set to IFS='' . What happens?? or what can you do with it??
I hope this isn't homework...
The while loop: it loops as long as 1 equals 1 (which is forever)
sid22
May 3, 2011, 4:01pm
3
lol.. it is not.. i am not asking anyone to do any coding for me :D.. just some coding i didnt understand so wanted to clarify.. :)
Start at position 0 and take 4 characters. And IFS is the Internal Field Separator. It controls how words get split. But I didn't see it in the code you posted.