input output redirection shortcut help

Is there a shorter way to do this using input and output redirection? I can’t get this work without using a temporary file.

          scanvirus "${View_Menu_Parms[Menu_Select]}" > "$view_file_temp"
          kdialog --textbox "$view_file_temp"
          rm "$view_file_temp"

My laptop is not working so my internet access is very limited. FYI…

Normally, you can do something like the following which creates a file descriptor to the output of the command. I’m not sure why but this doesn’t work with kdialog specifically.

kdialog --textbox <(scanvirus "${View_Menu_Parms[Menu_Select]}")

The following does appear to work though. I think this one is what you’re looking for:

kdialog --textbox /dev/stdin <<< "$(scanvirus "${View_Menu_Parms[Menu_Select]}")"
kdialog --textbox /dev/stdin 1024 512 <<< "$(scanvirus "${Scanlog_Menu_Parms[Menu_Select]}")"

This line works. Thanks rootetsy. :slight_smile:

PS, the above is not the cleanest line.

kdialog --textbox /dev/stdin 1024 512 <<< "$(scanvirus --viewlogs)"