Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nescafe
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
nescafe
15y ago
http://mywiki.wooledge.org/EnglishFrontPage
2.
▲
by
nescafe
15y ago
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 file set to '*.java'.
3.
▲
by
nescafe
15y ago
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. * The author uses sin
4.
▲
by
nescafe
15y ago
Find is overkill for this. for file in *.java; do [[ -f $file ]] || continue javac "$file" done
5.
▲
by
nescafe
15y ago
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 -- they are shell s