LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bash script output to console without login (http://www.linuxquestions.org/questions/linux-general-1/bash-script-output-to-console-without-login-853310/)

m.dam 12-30-2010 01:18 PM

Bash script output to console without login
 
Hi all,

i'm looking for a way to output a bash script to the console before login.
It should be executed after boot in rc.d scripts with the output on the console0. It is for a asterisk box.

This is the script. It use the watch command to output the active calls on the box in realtime.

Code:

watch "asterisk -vvvvvrx 'show channels verbose'"
Btw, happy new year!

catkin 12-30-2010 01:59 PM

So what's the question?

Scripts run from boot scripts have stdout and stderr connected to the console. IDK asterisk and whether it has virtual terminals but I find it useful not to start a virtual terminal on the /dev/console device (tty1) so the boot script messages continue being displayed.

rob.rice 12-30-2010 03:40 PM

dmesg will show the boot up messages
or you can look in /var/log/* for what happened during boot up

m.dam 01-07-2011 08:29 AM

Maybe i wasn't so clear.

I need a way to execute the script on system boot and show the output of the script in console without login.

Thanks!

catkin 01-07-2011 10:12 AM

Any reason not to create a rc.d script to do it?

m.dam 01-07-2011 10:30 AM

Yes, this is the way, but how can i show the output in the console ?
How can i redirect the output of the script to tty1 or tty2 ?

TB0ne 01-07-2011 11:07 AM

Quote:

Originally Posted by m.dam (Post 4216515)
Yes, this is the way, but how can i show the output in the console ?
How can i redirect the output of the script to tty1 or tty2 ?

How about just putting a "> /dev/tty1" when you do your variable output in the script? Or (better) put it through "tee", so it goes to both the log files and the console/terminal/whatever


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