Re: Passing tab char in command line
- From: nkalagarla@xxxxxxxxx
- Date: 31 May 2006 12:27:35 -0700
As Oliver mentioned the shell(cmd,sh,bash,ksh) is responsible for
escape processing of command line parameters. You could pass tab by
typing "(double quote) followed by tab key followed by "(double
quote).
In some shells(like cmd, bash) when you type TAB key they provide
command completion feature, if you type TAB once it fills with file
name. This should be disabled to pass just TAB character to the
application. For Windows, you could disable file and directory
completion by passing /F:OFF switch to cmd(cmd /F:OFF)or by updating
registry(more info at http://www.computerhope.com/cmd.htm).
-Rao
alejandrina wrote:
Hi all,
I want to pass a tab character as a command line parameter. Ihave this
statement to extract a char from the string:
char delim = args[0].charAt(0);
The problem is how do you write the command line? I've tried all of
these:
java testTab "\t"
java testTab "\\t"
java testTab \t
java testTab \\t
java testTab "\u0009"
java testTab \u0009
none work. "delim" above never gets the right character. Interestingly,
when I submit
java testTab "\u0009" or
java testTab "\\t"
args[0] contains a string of length = 2, the first character being "\"
and the second is the tab. Obviously, the parser feels the need to
"escape" my backslash character. How do you disable this behavior?
Thanks!
Alejandrina
.
- References:
- Passing tab char in command line
- From: alejandrina
- Passing tab char in command line
- Prev by Date: Re: 3DES Encryption
- Next by Date: Re: Assignment Linked List Help
- Previous by thread: Re: Passing tab char in command line
- Next by thread: Is there a dedicated unicode separator character?
- Index(es):
Relevant Pages
|
|