By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,797 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,797 IT Pros & Developers. It's quick & easy.

Java expands wildcards in command line arguments in Windows: documentation

P: n/a
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...argate.sgi.net

The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Your statement: "inspite of Windows not expanding shell wildcards" is
not true. Windows does expand the wildcard, just like bash or csh (unix)
does.

If you want to see what is actually being passed in, echo it:
echo java MyClass *

Echo works on both Windows and unix as well.

So this has nothing to do with Java at all.

Bharath Dhurjati wrote:
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...argate.sgi.net

The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.

Jul 17 '05 #2

P: n/a
Not under XP Pro.
echo *
prints "*"
Wild card expansion has never been a function of batch but is done by
whatever is run under batch, see the "for" command in batch for this.

Constantine

mhandis wrote:
Your statement: "inspite of Windows not expanding shell wildcards" is
not true. Windows does expand the wildcard, just like bash or csh (unix)
does.

If you want to see what is actually being passed in, echo it:
echo java MyClass *

Echo works on both Windows and unix as well.

So this has nothing to do with Java at all.

Bharath Dhurjati wrote:
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...argate.sgi.net
The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.


Jul 17 '05 #3

P: n/a
Not under XP Pro.
echo *
prints "*"
Wild card expansion has never been a function of batch but is done by
whatever is run under batch, see the "for" command in batch for this.

Constantine

mhandis wrote:
Your statement: "inspite of Windows not expanding shell wildcards" is
not true. Windows does expand the wildcard, just like bash or csh (unix)
does.

If you want to see what is actually being passed in, echo it:
echo java MyClass *

Echo works on both Windows and unix as well.

So this has nothing to do with Java at all.

Bharath Dhurjati wrote:
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...argate.sgi.net
The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.


Jul 17 '05 #4

P: n/a
nos
yes, there is no expansion under XP pro (just tried it too)

I don't have access to win 95 now, but years ago with turbo c++
there was no expansion either and Borland provided an
object file that you could link in to do the expansion prior
to invoking the program

"CD Rasmussen" <Co*******************@comcast.net> wrote in message
news:At********************@comcast.com...
Not under XP Pro.
echo *
prints "*"
Wild card expansion has never been a function of batch but is done by
whatever is run under batch, see the "for" command in batch for this.

Constantine

mhandis wrote:
Your statement: "inspite of Windows not expanding shell wildcards" is
not true. Windows does expand the wildcard, just like bash or csh (unix)
does.

If you want to see what is actually being passed in, echo it:
echo java MyClass *

Echo works on both Windows and unix as well.

So this has nothing to do with Java at all.

Bharath Dhurjati wrote:
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...ame=right&th=3
3f09e2bd3e85a8e&seekm=01be589d%24dc827700%24baac72 d1%40stargate.sgi.net

The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.

Jul 17 '05 #5

P: n/a
nos
yes, there is no expansion under XP pro (just tried it too)

I don't have access to win 95 now, but years ago with turbo c++
there was no expansion either and Borland provided an
object file that you could link in to do the expansion prior
to invoking the program

"CD Rasmussen" <Co*******************@comcast.net> wrote in message
news:At********************@comcast.com...
Not under XP Pro.
echo *
prints "*"
Wild card expansion has never been a function of batch but is done by
whatever is run under batch, see the "for" command in batch for this.

Constantine

mhandis wrote:
Your statement: "inspite of Windows not expanding shell wildcards" is
not true. Windows does expand the wildcard, just like bash or csh (unix)
does.

If you want to see what is actually being passed in, echo it:
echo java MyClass *

Echo works on both Windows and unix as well.

So this has nothing to do with Java at all.

Bharath Dhurjati wrote:
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...ame=right&th=3
3f09e2bd3e85a8e&seekm=01be589d%24dc827700%24baac72 d1%40stargate.sgi.net

The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.

Jul 17 '05 #6

P: n/a
You are right, it doesn't work under windows with echo, only under
unix/linux.

The following C program demonstrates that Windows does expand *:

#include<stdio.h>
int main(int argc, char **argv) {
int i;
for(i = 0; i < argc; i++) {
printf("arg %d = %s\n", i+1, argv[i]);
}
return 0;
}
As does the following Java program:

public class Test {
public static void main(String[] args) {
for(int i = 0; i < args.length; i++) {
System.out.println("arg " + (i+1) + " = " + args[i]);
}
}
}
CD Rasmussen wrote:
Not under XP Pro.
echo *
prints "*"
Wild card expansion has never been a function of batch but is done by
whatever is run under batch, see the "for" command in batch for this.

Constantine

mhandis wrote:
Your statement: "inspite of Windows not expanding shell wildcards" is
not true. Windows does expand the wildcard, just like bash or csh
(unix) does.

If you want to see what is actually being passed in, echo it:
echo java MyClass *

Echo works on both Windows and unix as well.

So this has nothing to do with Java at all.

Bharath Dhurjati wrote:
Hello,

I am looking for documentation that specifies the following behavior
exhibited by java.

The following (assuming MyClass.class is accessible and has a main())

java MyClass *

yields the same result on Windows as on Unix, inspite of Windows not
expanding shell wildcards. Basically, the args[] passed to main()
contains names of files in that directory.

The basic behavior is documented in the following link:
http://groups.google.com/groups?hl=e...argate.sgi.net
The last post by Kevin Kelley points this as 'specified' behavior for
java.exe.

The following link also points this as specified behavior.
http://www.cse.fau.edu/~roy/cop4331/asgmt1.html#jdk1.2

Now I am trying to find out exactly WHERE is this specified.
I have run searches on java.sun.com and used their documentation
searcher also, but couldn't find any documentation.

Can some one please help?

Thanks.

Regards,
Bharath.


Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.