Bash script only appears to process one line of file
I have a list of dates and times that I would like to convert to seconds since the epoch and these are stored in a file. I've written a shell script to do this and also generated some test data (because the actual file I want to run this on is quite large). My test data looks like this:
Thu Mar 30 2006 11:53:03 Fri Mar 31 2006 12:54:01 My shell script is the following: Code:
#!/bin/bash Any ideas? Thanks! |
Your script works fine for me.
Have you tried '#!/bin/bash -x' as the shebang line? Dave |
That doesn't help, but it doesn't matter too much. Thanks for the suggestion though :). I tried the script on another machine and it works fine there. Odd, must be a problem with my version of Bash :confused:.
|
Quote:
Code:
while read line Code:
cat dates | while read line |
My :twocents:
Code:
date +%s -f dates |
Quote:
Quote:
|
All times are GMT -5. The time now is 07:53 PM. |