Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: type the contents of a file (or stdin) #1

Merged
merged 1 commit into from
Dec 15, 2011

Conversation

chazmcgarvey
Copy link
Contributor

This patch adds a flag to the 'type' command (--file) which allows the contents of a file (or standard input) to be typed before (and in addition to) strings given as arguments. This would allow typing sensitive things (like passwords) that you don't want to have show up in process lists, command-line histories, or system logs.

Usage

xdotool type --file <somefile.txt

xdotool type --file - <<END
yada yada yada
END

You get the idea.

Caveats

Patch only makes the code changes. The pod is not updated to reflect this feature nor are any tests added.


/* determine whether reading from a file or from stdin */
if (!strcmp(file, "-")) {
input = fdopen(0, "r");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simply do 'input = stdin' here :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, I'll fix this, don't worry about it!

@jordansissel
Copy link
Owner

Excellent idea. No worries about the docs (and test) changes, I'll take care of those.

I'll test and merge shortly! :)

jordansissel added a commit that referenced this pull request Dec 15, 2011
Feature: type the contents of a file (or stdin)
@jordansissel jordansissel merged commit a25fbc6 into jordansissel:master Dec 15, 2011
@chazmcgarvey
Copy link
Contributor Author

Thanks, hope others find this feature useful. Nice code by the way; very easily hackable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants