Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

basic shell scripting

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
viktta
Posts: 22
Joined: 2014-11-13 22:48

basic shell scripting

#1 Post by viktta »

Hello,

I'm writting a little shell script.
This script contains 2 commands.
The first one, has to be executed in a new terminal.
The second one, in the terminal I executed my script.

The first command, is gonna make some calculations so it's gonna take some time (I need to see this information).


Any idea? Thank you all.

fruitofloom
Posts: 183
Joined: 2014-10-27 21:28

Re: basic shell scripting

#2 Post by fruitofloom »

could have sworn -e would be what you want, but the opened terminal would close right away.

What about:

Code: Select all

xterm -hold -e  "echo foo" &
echo foo

exit 0
"tee" comes to mind, to also write a logfile, but i don't get it sorted with a "forked" xterm. There should be a way to also log the calcualations (and i would really do that), but out of box i don't know.
Give me convenience or give me death.

User avatar
slackguy
Posts: 91
Joined: 2014-11-29 03:22

Re: basic shell scripting

#3 Post by slackguy »

well what do you mean terminal ? do you mean /dev/pty, (or better, /dev/tty) ?

you can use chvt(1) to change terminals in a script. to open one you can use gettty perhaps without login, run by the script, depends on your needs

or do you you mean screen output ? (for that, fbcon is spiff)

User avatar
slackguy
Posts: 91
Joined: 2014-11-29 03:22

Re: basic shell scripting

#4 Post by slackguy »

printf(1) "hello world\n" >> /dev/tty2 # if tty2 is there, if you just want output

bash can redirect streams (files that are copied to /dev/xxx) and even IP traffic (well awk can). and sockets are yet another trick.

but i'll stop there. there are just too many ways withotu knowing what you want

User avatar
aicardi
Posts: 388
Joined: 2009-11-18 01:30
Location: Chicago

Re: basic shell scripting

#5 Post by aicardi »

Sounds an awful lot like homework.
Jessie/Xfce

Post Reply