grep sda /etc/mtab 2>&1 tee /tmp/tab.txt | yad --title="output" \ --width=154 --text="$(cat /tmp/tab.txt)"
I’m not sure if that is working properly on my system. It opens a dialogue box that just has content “”
with cancel/ok buttons .
I tried populating a file tab.txt with a few lines because I am not sure if my results from the first part are what’s expected, which is 1 line. No matter what the content the best I can do is get the first line to show in the dialogue but not in an interactive way.
Tbh having a bit of a hard time following what’s going on with 2>&1 tee
. But I am not sure how it could be the right thing as I don’t see more than input
?
What I want is to open a dialogue like this:
yad --title "Create a file" --form --field="File name" --field="Content
where the user’s input gets directed to some sort of structure. Like an argument As though you had a terminal script with the syntax scriptname --filename=“file.txt” --content=“red green blue”
.
2>&1 sends error output to standard output which can be sent to a file, not all output you see on screen can do that.
You can use buttons and for each one it will execute a specific command, you add text to describe the button, and that is as far as yad will take you.
From system to system and from shell to shell expect some commands to work differently, I am using zsh on an arch based system called joborun
tee also varies substitute >
also for nvme you have no sda
I got the problem, some yad syntax when run as a command in bash it is read as bash script, take it, put it in a file, then run the file as script.
Too many quotes in it for bash to leave unnoticed :)
yad --title="output of command in yad " --width=350 --height=82 --text-align=left --text="$(grep a /etc/fstab)"
grep ext /etc/fstab > /tmp/zz
yad --title="output of file in yad box" --width=350 --height=82 --text-align=left --text="$(cat /tmp/zz)"