LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-30-2010, 12:18 PM   #1
m.dam
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
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!
 
Old 12-30-2010, 12:59 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.
 
Old 12-30-2010, 02:40 PM   #3
rob.rice
Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 784

Rep: Reputation: 99
dmesg will show the boot up messages
or you can look in /var/log/* for what happened during boot up
 
Old 01-07-2011, 07:29 AM   #4
m.dam
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
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!

Last edited by m.dam; 01-07-2011 at 07:30 AM.
 
Old 01-07-2011, 09:12 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Any reason not to create a rc.d script to do it?
 
Old 01-07-2011, 09:30 AM   #6
m.dam
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
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 ?
 
Old 01-07-2011, 10:07 AM   #7
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,198

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
Quote:
Originally Posted by m.dam View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH: Help with formatting Output from a script SilversleevesX Programming 4 08-23-2010 06:59 PM
Bash Script Missing Output Slick666 Programming 1 10-05-2007 07:09 AM
Test output from bash script estratos Programming 6 11-16-2006 09:01 PM
Bash Script, calculate output. eldaria Programming 13 07-20-2006 09:26 PM
change console title in bash script? TLV Linux - Software 18 10-08-2004 11:25 AM


All times are GMT -5. The time now is 05:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration