echo "hello" | kdialog --textbox -

I was hopping that row should pipe the word hello over to kdialog, and by setting the file argument to -, it should have used the piped text as content.

Is it possible to pipe the content to kdialog?


I'd use here strings to pass the text to kdialog stdin:

kdialog --textbox /dev/stdin <<< Hello

If you need to pass the output of a command you can use command substitution:

kdialog --textbox /dev/stdin <<< $(my_script.sh | sed_command)
  • as I have a script thats piped to sed, and then going to be displayed, so cant use here-strings. tried use echo "hello" | kdialog --textbox /dev/stdin but that didn't work :-( – Puggan Se Sep 2 '15 at 12:03
  • 1
    @PugganSe: You could try this sort of command kdialog --textbox /dev/stdin <<< $(my_script.sh | sed_command) – Sylvain Pineau Sep 2 '15 at 12:07
  • The comment version works, but the answer version dosn't work, won't accept it unless you update it to the working soloution – Puggan Se Sep 9 '15 at 8:19
  • 1
    @PugganSe: Sure thing, see my edit with command substitution – Sylvain Pineau Sep 9 '15 at 11:20

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.