Re: [gentoo-user] Re: extend a running shell command

2003-06-19 Thread CrPy
Hi ng,

first of all thanks for the discussion.

I'm think that there is no build-in function in bash, now. I thougth there 
could be an key-combination to handle that, like the ctrlz (of course you 
do not need alt). Moreover I think this could really be a security issue.

The trick with the shell script could work of course, but it is not so nifty I 
thougth it would be. ;-)

To extend a running command, we have found some solutions that are working I 
think. But to edit an entered command line is tricky and not trivial. The 
only solution I see is to extend the shell functionallity. Maybe there is an 
other shell that have this bug/feature, but don't know one.

THX

/CrPy


--
[EMAIL PROTECTED] mailing list



[gentoo-user] Re: extend a running shell command

2003-06-18 Thread CrPy
Hi ng,

sorry, but I think you don't get the problem. Type 
sleep 100h Enter
in your shell. And now don't kill it or stop it. Now imagine that you actually 
forgot what you really wanted: To halt the machine after the program (that 
already runs and may be it will need to run for some hours because it is a 
compile process or similar). And imagine that you don't want to sit all the 
time behind your computer and wait until the program finishes to be able to 
halt the computer. So, what I want is, to append to the aready running 
command line a new command without stopping the old (because then it would 
have to start it from the beginning). I think, it would be ok to suspend the 
running program temporarily and to resume it after a short time where I 
append the additional command to it.

After all it should look like i never executed
sleep 100h
but 
sleep 100h; halt

One solution I have is to suspend the command with ctrlaltz and type
fg; halt

But what if I have a longer queue of commands and I like to edit the command 
line.

e.g.
make clean  make dep  make bzImage  make module  make modules_install

And now I see that I have a typo in the line (the make module - make 
modules). How can I change the entered command line while excuting this 
command line?

Sorry, it was not easy for me to explain it in a way that somebody else could 
understand it. Maybe it is more clear now.

THX

/CrPy


--
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Re: extend a running shell command

2003-06-18 Thread Christopher Egner
Take a look at my example, I think the only way is to either add
commands into the shell itself (the core code of it) as some sort of
free linking nodes. Currently theirs no capacity, that I've ever seen to
edit the command line while its running. It could be dangerous too,
since some programs depend on knowing the commandline. Although in your
situation, it would seem safe enough.


On Wed, 2003-06-18 at 19:01, CrPy wrote:
 Hi ng,
 
 sorry, but I think you don't get the problem. Type 
 sleep 100h Enter
 in your shell. And now don't kill it or stop it. Now imagine that you actually 
 forgot what you really wanted: To halt the machine after the program (that 
 already runs and may be it will need to run for some hours because it is a 
 compile process or similar). And imagine that you don't want to sit all the 
 time behind your computer and wait until the program finishes to be able to 
 halt the computer. So, what I want is, to append to the aready running 
 command line a new command without stopping the old (because then it would 
 have to start it from the beginning). I think, it would be ok to suspend the 
 running program temporarily and to resume it after a short time where I 
 append the additional command to it.
 
 After all it should look like i never executed
 sleep 100h
 but 
 sleep 100h; halt
 
 One solution I have is to suspend the command with ctrlaltz and type
 fg; halt
 
 But what if I have a longer queue of commands and I like to edit the command 
 line.
 
 e.g.
 make clean  make dep  make bzImage  make module  make modules_install
 
 And now I see that I have a typo in the line (the make module - make 
 modules). How can I change the entered command line while excuting this 
 command line?
 
 Sorry, it was not easy for me to explain it in a way that somebody else could 
 understand it. Maybe it is more clear now.
 
 THX
 
 /CrPy
 
 
 --
 [EMAIL PROTECTED] mailing list
 


--
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Re: extend a running shell command

2003-06-18 Thread Robert Kruus
On Wed, 18 Jun 2003 21:01:02 +0200
CrPy [EMAIL PROTECTED] wrote:

 Hi ng,
 
 sorry, but I think you don't get the problem. Type 
 sleep 100h Enter
 in your shell. And now don't kill it or stop it. Now imagine that you actually
 
 forgot what you really wanted: To halt the machine after the program (that 
 already runs and may be it will need to run for some hours because it is a 
 compile process or similar). And imagine that you don't want to sit all the 
 time behind your computer and wait until the program finishes to be able to 
 halt the computer. So, what I want is, to append to the aready running 
 command line a new command without stopping the old (because then it would 
 have to start it from the beginning). I think, it would be ok to suspend the 
 running program temporarily and to resume it after a short time where I 
 append the additional command to it.
 
 After all it should look like i never executed
 sleep 100h
 but 
 sleep 100h; halt
 
 One solution I have is to suspend the command with ctrlaltz and type
 fg; halt
 
 But what if I have a longer queue of commands and I like to edit the command 
 line.
 
 e.g.
 make clean  make dep  make bzImage  make module  make modules_install
 
 And now I see that I have a typo in the line (the make module - make 
 modules). How can I change the entered command line while excuting this 
 command line?
 
 Sorry, it was not easy for me to explain it in a way that somebody else could 
 understand it. Maybe it is more clear now.
 
 THX
 
 /CrPy
 
 
 --
 [EMAIL PROTECTED] mailing list
 

If I understand correctly, all you have to do is type the command.
The terminal will still accept input and should run the command after the first
has run.
If you do notice an error (as in your example), the command will terminate
where ever you had your typo.
So in your example, just type in the rest of your command again  properly
starting with:
make modules  make modules_install
Then, when the first part terminates with the error, the next section will
proceed.

It is however some times difficult to type if you have output from your
job/process spilling on your screen.  The shell is still capturing your
characters however.
(Try cat some_long_file and then type logout/ls/pwd... as it is scrolling by)




--
Robert Kruus --- [EMAIL PROTECTED]
What we know is not much. What we do not know is immense.
Pierre-Simon Laplace (1749-1827)
Quoted in Budget of Paradoxes

--
[EMAIL PROTECTED] mailing list