Linux extacting msg from script to console


 
Thread Tools Search this Thread
Operating Systems Linux Linux extacting msg from script to console
# 1  
Old 11-12-2014
Linux extacting msg from script to console

how to get the outout from script to console.

i am running one script msg.sh using cron job every suday midnight. as soon as i logged in i want to see the staus is service started or service failed on console.

what command i need to add to script ?

msg.sh
Code:
#!/bin/bash
if [ -e /user/script/$start.sh]
then 
   echo "starting  service"
else
   echo " service not started" 
   echo " Please check the start.sh file or manuly start the service" 
fi

if i login with root credentials @12.36.34.123 with passwd
Code:
username:root
passwd:abc

i once i logged in linux service started or service failed ( out put of the script ) should be printed on console.

how to check or how to extract messages in linux from var/log/message to current console


Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. Thanks

Last edited by vbe; 11-12-2014 at 05:11 AM..
# 2  
Old 11-12-2014
Thread closed double posting is not allowed in these forums
Continue here:
How to redirect the messages from the script to console in Linux?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Linux Console for Interactive Input Script

Hi there, How do I enter command to the interactive console. I was able to do it via the first line. What if I have more lines to input into the interactive console from line 3 onwards. Is there a more easier way? (echo -e "load openvas" ; echo -e "openvas_help") | msfconsole ... (4 Replies)
Discussion started by: alvinoo
4 Replies

2. Shell Programming and Scripting

How to redirect the messages from the script to console in Linux?

msg.sh #!/bin/bash if then echo "starting service" else echo " service not started" echo " Please check the start.sh file or manuly start the service" fi if i login with root credentials @12.36.34.123 with passwd username:root passwd:abc once i login into linux pc... (6 Replies)
Discussion started by: saku
6 Replies

3. UNIX for Dummies Questions & Answers

Warning msg from .sh script to web user?

Hello out there, I got a script that stops and restarts a webapp. I would like to be able to send warning reminders to the webusers as a warning like 5 minutes before it happens. Can I do this an if so how? (1 Reply)
Discussion started by: vsekvsek
1 Replies

4. Shell Programming and Scripting

My script is working but why do I get this msg?

Hi, I have a script to determine the max memory to set a worker to start up at. The variable will need to end up being "-Xmx512m" or "-Xmx256m" or "-Xmx768m." Everything works fine BUT when I set the "MEMORY" variable I get the "Cmmand not foundine 40: -Xmx512m" msg though the variable is the... (5 Replies)
Discussion started by: vsekvsek
5 Replies

5. UNIX for Dummies Questions & Answers

Msg before exiting pseudo-console

Hi! I want to display a message when I leave a pseudo-console (/dev/ptsX: konsole, xterm) e.g "Bye! There's still 3 pts open and 3 background processes" I can do it in login-terminals (via .bash_logout) but not in a non-login... Any ideas? (5 Replies)
Discussion started by: funyotros
5 Replies

6. Red Hat

Linux console

Dear All, I have some Linux Servers in Data Center. I can access those servers through Telent or Putty. But If i want to work on the console I cannot do that. How to configure Console access for my Linux Server , So that I can work on the Console if it goes in to Single User mode. ... (2 Replies)
Discussion started by: jegaraman
2 Replies

7. UNIX for Dummies Questions & Answers

Windows to Linux remote console using VNC brings up blank console screen with only mouse pointer

:confused:Hi This was installed on the Linux box a few weeks back by a guy that no longer works for us. All worked fine until last week. Now when we connect its just a blank screen with no icons. I get a whole bunch of errors when starting the service too: Tue Feb 23 14:29:45 2010 ... (1 Reply)
Discussion started by: wbdevilliers
1 Replies

8. Red Hat

Doubt on Linux console

Can anyone explain me the usage of momentary press, press and hold, Reset.. I usually use cold boot option which is used to boot the system. Any help on the other options is really helpful thanks in advance (5 Replies)
Discussion started by: rogerben
5 Replies

9. UNIX for Dummies Questions & Answers

connecting to a database through a script...if not give an error msg

Hello , i have a problem in writing the shell script.. i have a script already written n just need to make a change in which when the script is not able to connect to the database ..it should print an error msg on the screen. I have already seen previous posts on how to connect to the... (3 Replies)
Discussion started by: sommer_queen
3 Replies

10. UNIX for Dummies Questions & Answers

Starting up linux to Console

How do i start linux without going straight into X window enviroment, but into the console instead, and also, how do i get back in ? (2 Replies)
Discussion started by: stealthdestroyr
2 Replies
Login or Register to Ask a Question