LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   news command? (https://www.linuxquestions.org/questions/linux-general-1/news-command-134114/)

wenberg 01-12-2004 05:11 PM

news command?
 
I don't know where this should go ... but how do I make a command that when a user types "news", they get displayed the server news. I'm thinking of having a text file that contains the news and having a command that just does "cat newsfile" or something of that sort... but how do I make the command "news" that does "cat newsfile" available for all users on the system?

david_ross 01-12-2004 05:15 PM

How about creating a traditional text file for your news:
/etc/motd

Then edit /etc/bashrc and at the end add a line:
alias news='cat /etc/motd'

You could also do it via less with:
alias news='less /etc/motd'

trickykid 01-12-2004 05:33 PM

Or instead of adding them to the motd file, just create an alias that echos the news servers when simply typing 'news', etc.

wenberg 01-12-2004 05:49 PM

I don't have the file /etc/bashrc. Where should alias' be put? I'm using Slackware 9.1 Thanks in advance.

trickykid 01-12-2004 05:58 PM

Quote:

Originally posted by wenberg
I don't have the file /etc/bashrc. Where should alias' be put? I'm using Slackware 9.1 Thanks in advance.
By default Slackware doesn't create or have a .bashrc file, you'd have to create one. If you don't want to do that, just simply put your aliases in /etc/profile

Cheers

wenberg 01-12-2004 08:11 PM

Thank you very much to both of you. :)


All times are GMT -5. The time now is 12:31 AM.