LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-12-2004, 05:11 PM   #1
wenberg
Member
 
Registered: Jan 2004
Location: Minnesota, USA
Distribution: Slackware 10, Debian Sarge
Posts: 91

Rep: Reputation: 15
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?
 
Old 01-12-2004, 05:15 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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'
 
Old 01-12-2004, 05:33 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Or instead of adding them to the motd file, just create an alias that echos the news servers when simply typing 'news', etc.
 
Old 01-12-2004, 05:49 PM   #4
wenberg
Member
 
Registered: Jan 2004
Location: Minnesota, USA
Distribution: Slackware 10, Debian Sarge
Posts: 91

Original Poster
Rep: Reputation: 15
I don't have the file /etc/bashrc. Where should alias' be put? I'm using Slackware 9.1 Thanks in advance.
 
Old 01-12-2004, 05:58 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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
 
Old 01-12-2004, 08:11 PM   #6
wenberg
Member
 
Registered: Jan 2004
Location: Minnesota, USA
Distribution: Slackware 10, Debian Sarge
Posts: 91

Original Poster
Rep: Reputation: 15
Thank you very much to both of you.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux in the news debianmike Linux - News 4 10-14-2005 10:23 PM
News hpcnews Linux - General 2 03-09-2004 07:57 AM
News hpcnews General 1 03-09-2004 02:33 AM
Probably old news... r_jensen11 General 7 12-10-2003 05:54 PM
news jISV Linux - General 0 05-12-2002 02:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:26 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