Shell infinite loop hell
Code:
ExtractDir() |
Ooops I need "quotation marks."
Nope, that wasn't the answer. What is the answer? |
Quote:
while [ != ] And not seeing anything to compare true or false. This is why it didn't matter whether you were comparing using != or = ... it wasn't actually doing a valid comparison. If you change the values of $tmp and $term to, say, 'X', your loop will terminate. |
It's a good idea when doing string comparisons to quote the strings in question, i.e.
Code:
[ "$string1" = "$string2" ] |
Quote:
Code:
while [ "x$tmp" != "x$term" ] I forget all the rules for how bash decides what is an empty string because I just use the syntax above, and it always works. |
i am more curious about what you want to do instead.
besides that, you can cut down on the cuts...and use -ls instead of -exec ls Code:
find /path -type l -ls | awk '{print $(NF-3),$NF,$(NF-2)} Code:
find /path -type l -printf "%AH:%AM %p %l" |
All times are GMT -5. The time now is 06:29 PM. |