LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-08-2004, 12:45 AM   #1
marlor
Member
 
Registered: May 2004
Distribution: Slackware C
Posts: 274

Rep: Reputation: 30
"at" command help


hi everyone,

for the ones who don't knwo "at" it's something like cron which executes a job at a certain time.

well cron is more for automating jobs, at is more for one timer job, e.g you want to echo on your tty1 "hey it's time for beer" at 18:00

i can do that:
Code:
at 18:00
at> echo "hey it's time for beer" 1> /dev/tty1
what i cannot do is to launch a program in the specified tty, i got help before but it works partialy:

Code:
at 18:00
at> export TERM=linux
at> pico 1> /dev/tty1
this code pops up pico on tty1 at 18:00 but it just displays it and it is not useable, try it yourself you will know what i mean.

QUESTION:
any suggestions how to launch a program in a useable way?


thanks in advance
 
Old 08-08-2004, 05:50 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
This is impossible, or at least quite hard to realize.
Reason is that "at" works by having a daemon running in the background (the at-daemon, call "atd"). One of the most important features of a daemon is that it detaches itself from any terminal, and ensure it will never be able to get a terminal ever again. So all stuff started by "atd" will not have a terminal either. And this is exactly what "at" is meant to do: running program unattended, in the background,without needing a terminal.

The only way I can think of doing this with "at" is this:
Make and "at" job that starts a tty process on a free virtual terminal, like the "login" program does, (which is started at boot time by "init"). Then have that tty switch UID and start "pine".

This way it will run on a new virtual terminal, not one already running. This is probably not what you want. And you need to write some non-trivial program in C (or similar) to do the stuff described above. And have at run it as root.
 
Old 08-08-2004, 06:06 AM   #3
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
any suggestions how to launch a program in a useable way?

As Hko said, you can lauch every program that does not depend of a terminal, like most of X programs
 
Old 08-08-2004, 06:10 AM   #4
marlor
Member
 
Registered: May 2004
Distribution: Slackware C
Posts: 274

Original Poster
Rep: Reputation: 30
i'll be starting C,C++,java this semester in uni so i'll have to wait for that one
 
Old 08-08-2004, 06:12 AM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Now that I 'm thinking, why don't you use something like this :

sleep 120 && pico
 
Old 08-08-2004, 06:33 AM   #6
marlor
Member
 
Registered: May 2004
Distribution: Slackware C
Posts: 274

Original Poster
Rep: Reputation: 30
yes thanks that seems to be a good alternative which i didn't think of but is it possible to send the "sleep" to background and when it's time display pico in forground as normal?

something like:

sleep 100&; pico
or
sleep 100& && pico
or
sleep 100 && pico& (well this one also sends pico to the bg)

well the above don't work, either not what i was hoping for, or i get syntax error
is there a way to tacle this?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
cdrecord command-line parentheses "(" ")" coolingtower Linux - Software 1 10-28-2005 11:49 AM
"stalled" problem in " scp" command gentleshark Linux - Networking 1 08-29-2005 12:41 PM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration