You are not logged in.
I want a bash script to run makepkg inside a dedicated urxvt window. I can do this as follows:
urxvt --geometry 100x30 -e bash -c "makepkg -src"The problem is that the above command is being calling inside a for loop. Each time this code is called, makepkg runs BUT it runs in a different instance of urxvt. I want each subsequent instance of makepkg to run in the same urxvt window. I think the --hold switch might help here but I do not know how I can direct each loop into the same window.
Thanks in advance.
Offline
If I understand you correctly, you may run urxvt as a daemon and launch urxvtc instead.
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
I don't think -hold would do what you want, as it only keep the window open after the program execution, but (I don't think) you can re-use that window with another program.
Any reason you can't just do `makepkg -src` instead, and run your bash script containing the loop with `urxvt --geometry 100x30 -e foobar` ? That way all output should be in the same window.
Offline
I've never done this, but as I understand them, you could use a named pipe (FIFO). You would set up the pipe and new terminal window outside the loop, and have the script in the new terminal window listening on the pipe, then in the loop send the commands - or the dirs/files/etc on which the commands will act - to the pipe for processing.
EDIT: or you might be able to use something like xdotool or similar to send the commands to the window. Again, I've never tried running commands at the prompt with x automation tools, but it might be possible with one of them.
Last edited by skanky (2012-04-03 09:24:05)
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
I'd second bohoomil's suggestion as the simplest if it could work. You wouldn't necessarily need another script file though. The following wiill run:
#!/bin/bash
urxvtc -e bash -c "
echo hello
echo world
read line
"The echos could be changed to makepkg commands. The read line is only there so the window sticks around long enough to see the output.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Based on Trilby's script, you could build a list of commands with the loop, and pass them to the window as a parameter to eval:
$CMDS="echo hello;echo world;read"
$urxvtc -e bash -c "eval $CMDS""...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline