Open GoogleCodeExporter opened 9 years ago
You said that the following command produced unexpected output:
xdotool type Hello all how is everything going?
That output is unexpected *by you*.. You said that the expected output would
have been "Hello all how is everything going?" but this is not the case. This
is not an issue with xdotool, but with your use of bash or whatever shell you
used to type the xdotool command.
As an illustration, consider what would happen if, instead of a space, you had
a [Tab] [2 spaces] [Tab] in between "Hello" and "all" and "how" .. etc.? You
would probably expect xdotool to type the tab-space-space-tab in between, but
the fact is, xdotool *does not know* what you typed between the words. That
information is not given to the xdotool progra by your shell.
See http://mywiki.wooledge.org/WordSplitting
The proper way to do it is to use quoting: xdotool type 'Hello all how is
everything going?' Within the quotes, you can do tab-space-space-tab etc. and
xdotool will faithfully reproduce it.
Original comment by kiikrafi...@gmail.com
on 10 Feb 2012 at 11:33
I have the same issue however the quotes will not solve my issue. I am having xdotool type a string taken from a text file using "shuf -n 1 file.txt" and I set that command as a variable.
So:
GEN="$(shuf -n 1 file.txt)"
xdotool type $GEN
I have tried all manner of methods to force xdotool to include spaces in the strings from the text file but nothing is working. It has nothing to do with the shell, nor does it have anything to do with my ability to code. This is a bug in xdotool.
I know this is a couple years old, but in case someone ends up here from google - you just need to do
xdotool type "$GEN"
For this to work as expected.
Original issue reported on code.google.com by
firedrag...@gmail.com
on 25 Nov 2011 at 2:59