Re: Passing tab char in command line



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

.



Relevant Pages

  • Re: Passing tab char in command line
    ... I want to pass a tab character as a command line parameter. ... input to a program which is typically called a "shell". ...
    (comp.lang.java.programmer)
  • Re: Problem with a conditional part of Makefile
    ... I was using quotes. ... That's because you still have the tab character at the start of the ... but that example is for the use of a conditional in the command ...
    (comp.unix.programmer)
  • Re: Passing tab char in command line
    ... I want to pass a tab character as a command line parameter. ...
    (comp.lang.java.programmer)
  • Re: Problem with a conditional part of Makefile
    ... I was using quotes. ... That's because you still have the tab character at the start of the ... next line - if there's a tab it's taken to be a command and commands ...
    (comp.unix.programmer)
  • Re: Ion3 a good light GUI.
    ... If you use `apt-cache search' from a command line, you can try searching for your applications that way. ... Workspaces are helpful: I keep my GAIM buddy list, terminal from which I play music, and Thunderbird in a separate workspace. ... I installed Ion3 a few weeks ago already now, and when running several greedy applications at same time, such as Thunderbird, Firefox, plus Blender and Galeon, just now, Ion3 allows my machine not to get stocked with a freezed GUI. ... To open one more tab it's with mouse or with Ctrl+Shift, and all applications open in new tabs beside one to the other. ...
    (Ubuntu)