Program running and also see a terminal
Program running and also see a terminal
I have a shell script file for a program.
What command can I add that will make the terminal show when the program runs?
Where would this code go in the script?
I want to be able to see what is happening with the code as the program operates.
The terminal should show this as the program operates.
What command can I add that will make the terminal show when the program runs?
Where would this code go in the script?
I want to be able to see what is happening with the code as the program operates.
The terminal should show this as the program operates.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Re: Program running and also see a terminal
bigpup wrote:Where would this code go in the script?
So please give us a clue. What does the script look like and what is it supposed to do? And the program: Is it intended to run in a terminal and "show what is happening to the code"? If so you could start it from a terminal or start a script that starts a terminal that starts the program, but I'm alreay drifting into a cloud of speculation....[url=http://www.murga-linux.com/puppy/viewtopic.php?t=90471]Long time ago[/url] bigpup wrote: The things you do not tell us are usually the clue to finding the answer
HI bigpup.
As MochiMoppei mentioned, you're a bit in the vague.
This is what I do when I want to observe the execution of a script
in a terminal (all words are important in this sentence):
If the script has errors, the "set -xe" makes ths script stop at every error
so you can correct it.
There are other ways.
IHTH
As MochiMoppei mentioned, you're a bit in the vague.
This is what I do when I want to observe the execution of a script
in a terminal (all words are important in this sentence):
Code: Select all
set -xe # at the top, below the crunch-bang
Code: Select all
set +xe # as the last line.
so you can correct it.
There are other ways.
IHTH
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Ok let me ask this a different way.
Here is the program.
When it runs the terminal also shows.
So what in the program code is making it do this and how to stop it?
Here is the program.
When it runs the terminal also shows.
So what in the program code is making it do this and how to stop it?
- Attachments
-
- yapi.pet
- (12.18 KiB) Downloaded 129 times
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
I think the 50th line try hashing it out.
I tried it on Fatdog, it runs without the terminal after hashing that out. Not thoroughly tested.
It's taking too much time searching for ISO files in my drives. (Which is same when the terminal is shown, while terminal is showing no msgs.)
Edit: It finally gave me a list of all ISOs I have. Damn I have too many Pups idle.
Code: Select all
exec urxvt -bg "#ffffe0" -fg black -title "$TITLE" encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext -e "$0" "$@"
I tried it on Fatdog, it runs without the terminal after hashing that out. Not thoroughly tested.
It's taking too much time searching for ISO files in my drives. (Which is same when the terminal is shown, while terminal is showing no msgs.)
Edit: It finally gave me a list of all ISOs I have. Damn I have too many Pups idle.
With the terminal shown, the program didn't show any output in it till the list of ISOs was shown.
Maybe it will show after the iso to install is selected...
I don't have a spare usb drive now to test it out.
Maybe I will try it in qemu in Fatdog.
Edit: Sorry got to go, daughter is calling me for dinner. See ya later.
Maybe it will show after the iso to install is selected...
I don't have a spare usb drive now to test it out.
Maybe I will try it in qemu in Fatdog.
Edit: Sorry got to go, daughter is calling me for dinner. See ya later.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
@bigpup
drunkjedi is right.
[ -t 0 ] tests if the script was started from a terminal. If not it starts one (urxvt) and tells urxvt to run the script.
After restarting in the newly created urxvt it will pass through this test because it now is running in a terminal and can continue to execute the code after line 50. Commenting out the whole line should disable this test and the creation of urxvt.
I wonder why the script is so keen to run in a terminal. Messages to the user don't make use of the terminal but are sent via a GUI dialog. Could be a safeguard against unexpected errors and hang-ups. I recommend to keep the line and the terminal.
drunkjedi is right.
Code: Select all
[ -t 0 ] || exec urxvt -bg "#ffffe0" -fg black -title "$TITLE" encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext -e "$0" "$@"
After restarting in the newly created urxvt it will pass through this test because it now is running in a terminal and can continue to execute the code after line 50. Commenting out the whole line should disable this test and the creation of urxvt.
I wonder why the script is so keen to run in a terminal. Messages to the user don't make use of the terminal but are sent via a GUI dialog. Could be a safeguard against unexpected errors and hang-ups. I recommend to keep the line and the terminal.
This search can take some time.drunkjedi wrote:It's taking too much time searching for ISO files in my drives.
Edit: It finally gave me a list of all ISOs I have. Damn I have too many Pups idle.
Especially if you have a lot of places to search and a lot of iso's to find.
This search feature of the program will look on any storage devices hooked to the computer. Hard drives, usb drives, micro cards, anything.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
Thanks for the information on what you found!!!!!!!!!
I think this terminal showing is left over from development of the program. Wanted to see what was happening with the code. Spent a lot of time working out bugs and tweaking how it would work.
After all the code changes that where made, over several months.
I kind of forgot what was doing the terminal showing.
I was also thinking this was the code:"
Just seems to be a lot of code just to make the terminal show as the program operates.
As you say, it seems to still work OK with this hashed out.
Thanks ALL for the help!!!!!!!!!!!!!!!!!!!!
I think this terminal showing is left over from development of the program. Wanted to see what was happening with the code. Spent a lot of time working out bugs and tweaking how it would work.
After all the code changes that where made, over several months.
I kind of forgot what was doing the terminal showing.
I was also thinking this was the code:
Code: Select all
[ -t 0 ] || exec urxvt -bg "#ffffe0" -fg black -title "$TITLE" encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext -e "$0" "$@
Just seems to be a lot of code just to make the terminal show as the program operates.
As you say, it seems to still work OK with this hashed out.
Thanks ALL for the help!!!!!!!!!!!!!!!!!!!!
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
This reminds me of something someone in my office did when I was working at Granada TV rental.This search can take some time
Now you need to know that from our office in Bedford we had connections to every Granada TV shop in the world as well as all the studios and service centres etc.
All he did was write a simple query to find out whether the printer was out of ink or not. Then he remembered that there was another printer in the next office and thought he would check that as well to save two trips to the stationary office for refills.
Unfortunately he queried all online printers and forgot to limit the locaction.
So 6 hours later he got his answer from EVERY SINGLE PRINTER IN THE ORGANISATION THROUGHOUT THE WORLD.
"Just think of it as leaving early to avoid the rush" - T Pratchett
Yes, you must be smarter than the software you are coding
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
Hi Burn_IT.Burn_IT wrote:This reminds me of something someone in my office did when I was working at Granada TV rental.This search can take some time
Now you need to know that from our office in Bedford we had connections to every Granada TV shop in the world as well as all the studios and service centres etc.
All he did was write a simple query to find out whether the printer was out of ink or not. Then he remembered that there was another printer in the next office and thought he would check that as well to save two trips to the stationary office for refills.
Unfortunately he queried all online printers and forgot to limit the locaction.
So 6 hours later he got his answer from EVERY SINGLE PRINTER IN THE ORGANISATION THROUGHOUT THE WORLD.
What happened to the man? Did he get fired or did he get a promotion?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
As far as I know he is still busy replacing ink cartridges!!!
The last I heard he was a man manager at the same place - no technical responsibilities at all.
That actually was one thing they were good at. That was recognising that technically able people made bad managers and good managers were technically challenged so they had parallel career paths.
The last I heard he was a man manager at the same place - no technical responsibilities at all.
That actually was one thing they were good at. That was recognising that technically able people made bad managers and good managers were technically challenged so they had parallel career paths.
"Just think of it as leaving early to avoid the rush" - T Pratchett
Never let a manager tell you how you should do your job
Well, make them think you are going to do it the way they say, but do it the way you know works!
Would you want to work for this guy?
Well, make them think you are going to do it the way they say, but do it the way you know works!
Would you want to work for this guy?
- Attachments
-
- bulldog.jpg
- (10.92 KiB) Downloaded 86 times
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
The only change I would make to that is it is good practice to work the situation so that he ends up telling you to do it the way you were going to anyway, yet thinks it is his idea. That is unless you have ambitions on taking over from him, which as I suggested, may not be a good idea.
Let the manager think HE is in control and everything will be sweet.
The same idea works with spouses.
Let the manager think HE is in control and everything will be sweet.
The same idea works with spouses.
"Just think of it as leaving early to avoid the rush" - T Pratchett