http://mywiki.wooledge.org/EnglishFrontPage
Incorrect. Word splitting does not happen in [[ ]] tests. The only reason I had the [[ -f $file ]] || continue is to handle the case where there are no .java files, which will cause the for loop to iterate once with…
Linked article is actually a really horrible intro to bash -- at best, it is an OK intro to pre-POSIX bourne shell scripting. Specifically: * test and [ ] are fraught with parameter expansion peril. Use [[ ]] instead. *…
Find is overkill for this. for file in *.java; do [[ -f $file ]] || continue javac "$file" done
No, that is just wrong. In double-brackets, bash will handle expansion and testing of unset variables and variables with spaces just fine, because word splitting and pathname expansion are not performed in double braces…
http://mywiki.wooledge.org/EnglishFrontPage
Incorrect. Word splitting does not happen in [[ ]] tests. The only reason I had the [[ -f $file ]] || continue is to handle the case where there are no .java files, which will cause the for loop to iterate once with…
Linked article is actually a really horrible intro to bash -- at best, it is an OK intro to pre-POSIX bourne shell scripting. Specifically: * test and [ ] are fraught with parameter expansion peril. Use [[ ]] instead. *…
Find is overkill for this. for file in *.java; do [[ -f $file ]] || continue javac "$file" done
No, that is just wrong. In double-brackets, bash will handle expansion and testing of unset variables and variables with spaces just fine, because word splitting and pathname expansion are not performed in double braces…