How is the correct technique handle a dir. name under Home with space

2020-08-23 Thread almahdi
that needs to be used in such that dir. name is put in a way say:

n="~/foo bar"

if forced to do

$ pushd "$n"

when used in such

$ popd

bash: popd: ~/foo bar: No such file or directory

Any sincere guide to solve is invaluable helpful




--
Sent from: http://gnu-bash.2382.n7.nabble.com/



Re: How is the correct technique handle a dir. name under Home with space

2020-08-23 Thread Robert Elz
Date:Sun, 23 Aug 2020 04:58:16 -0700 (MST)
From:almahdi 
Message-ID:  <1598183896339-0.p...@n7.nabble.com>

  | that needs to be used in such that dir. name is put in a way say:
  |
  | n="~/foo bar"

n=~/'foo bar'

or if you prefer  n="${HOME}/foo bar" since ~/ is the same as ${HOME}/

kre




Re: Is this a bug?

2020-08-23 Thread Dale R. Worley
George R Goffe  writes:
> Shouldn't there be a message about no file found presented by bash?
> There appears to be NO indication that filename completion has failed
> to find a file.

I'm not very experienced using filename completion, but my understanding
is that completion indicates "there is no file with this prefix" by
ringing the bell, and I assume that specifically means emitting a \007
character.  bash depends on whatever "terminal program" it is running
under to give the user an indication that \007 has been emitted.

In the one system to hand, the terminal program is xterm, but it gives
no indication for \007.  And my memory is that over the years, support
for "the bell" has been poor and inconsistent.

Now maybe there's a way to configure bash to indicate
no-completion-choices in a different way.

> I'm at a loss as to what to do at this point. What I would like to be
> able to ctrl-c out of filename completion.

Sorry, I've re-read your messages and I can't tell what your situation
really is.  Can you describe a test case where you can't ctrl-c out of
filename cmopletion, including the facts about the files involved, the
exact sequence of what you type, and the behavior you observer?

Dale



How do we intercept file saving or output to stdout directly

2020-08-23 Thread almahdi
How do we intercept and redirect file saving or output to stdout directly in
bash, just like e.g

xkbcomp $DISPLAY

will output and generated a file, but what needed is to put it directly to
stream of stdout which will be piped once.
Tried,

$ xkbcomp $DISPLAY >(cat)
Error:Cannot open "/dev/fd/63" to write keyboard description
  Exiting

$ xkbcomp $DISPLAY /dev/stdout
Error:Cannot open "/dev/stdout" to write keyboard description
  Exiting

Anyone experience or have insight on this ?




--
Sent from: http://gnu-bash.2382.n7.nabble.com/