3

I have a script that needs a file as argument :

./myscript --file filename.txt

xkcdpass generates lists of passphrase as output .

How can I PIPE the output of xkcdpass , as a file, to myscript ??

Till now I tried this :

./myscript --file | xargs xkcdpass

... but it does not work.

2

I assume that xkcdpass generate a list of passwords and you do not want to store in a file.
You can try to create a FIFO.

mkfifo ~/MyOutput 
xkcdpass > ~/MyOutput &   # & to execute it in the background

then

./myscript --file ~/MyOutput

from info coreutils 'mkfifo invocation':

A "FIFO" is a special file type that permits independent processes to communicate. One process opens the FIFO file for writing, and another for reading, after which data can flow as with the usual anonymous pipe in shells or elsewhere.


You should try also

xkcdpass | xargs -n 1  ./myscript --file

You can read more:

1

"How can I PIPE the output of xkcdpass , as a file, to myscript ??"
With a process substitution:

./myscript --file <(xkcdpass)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.