LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-26-2009, 08:25 AM   #1
KLIK
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
Question Custom Commands


Hi, I'm new to linux, I've CentOS on my server and i wanted to know how to make custome commands to perform tasks,

like some shell hosters have made commands like ' get-psy ' to install psybnc itself , 'get-irc' this command will configure,make & intall some irc software itself... etc etc. So How do we do this?
 
Old 07-26-2009, 11:03 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Why would you want to do that? On CentOS you'd just run "yum install whateverprogramyouwant", isn't that simple enough? creating such a trivial script to remove a lot of the flexibility seems really strange.
 
Old 07-26-2009, 12:49 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,899
Blog Entries: 27

Rep: Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186
Hi,

Welcome to LQ!

I agree with the Mod but if you want to understand the script then look at 'Advanced Bash-Scripting Guide'.

The above link and others available from 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 07-27-2009, 04:41 AM   #4
KLIK
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks

Thanks for your reply acid and onebuck. Actually Its Not Just For Downloading And Installing, I wanted to put some more custom commands, like restart-psy...to restart the psybnc etc etc. kind of shortcut keys. And Also Wanted to learn more, like I want to put some script in the motd which shows the name of the software and processes running like:

Number of IRCd's Running ..... (0)
Number Of PsyBnc's RUnning .... (3)
NUmber Of Eggdrop's Running .... (6)
etc etc.

Is there some pre-made scripts for this purpose available?
 
Old 07-27-2009, 09:59 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
well certainly you could create them with a bash script:

#!/bin/bash
/etc/init.d/psybnc restart

or an alias:

alias restart-psy='/etc/init.d/psybnc restart'

But as above, it's a little too trivial to bother with I think. In terms of mining out additional data, then sure, a shell script or such would be ideal if there's nothing to do it already. Quite what it would actually do I couldn't say though...
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
custom commands saikoushik Linux - Newbie 2 12-23-2008 03:21 AM
utility for sending custom UDP commands to network device helsing Linux - Networking 1 02-29-2008 02:13 PM
Custom Bash Commands tryLinux&see Linux - General 8 02-26-2007 08:16 AM
PHP running custom commands Tralce Linux - Server 10 11-20-2006 01:04 PM
Useful custom commands for Slackware thegeekster Slackware 56 03-08-2005 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:10 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration