LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 08-31-2004, 02:40 PM   #1
entob
LQ Newbie
 
Registered: Mar 2004
Location: Norway
Distribution: Slackware 9.1
Posts: 17

Rep: Reputation: 0
Question Automating simple commands, scripting or programming?


Hey...


I would like to automate simple commands in FreeBSD, an example:

Instead of this:
# cd /usr/ports/../..
# make install clean

Do this?
# mycommand -ic program

This command would then be available and functional from any directory, and maybe write an installation log, maybe later some dependency functions etc.?


So how would i write this code, and then what? Is there a simple programming language, some sort of scripting, or another program out there for this type of situation?


I'm new to UNIX-like environments, even newer to FreeBSD and I have little experience with programming!
 
Old 08-31-2004, 02:44 PM   #2
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Rep: Reputation: 30
Which shell do you use? If you need to find out (Bash is blatently obvious) you can just type echo $SHELL. After you find that out, you can find guides on shell scripting. Shell scripting could automate that process for you. If you want it avalible from any directory you could just add it into your $PATH:
Quote:
$ export PATH=$PATH:/path/to/where/script/is
Good luck.
 
Old 08-31-2004, 03:50 PM   #3
Lurker01
Member
 
Registered: Aug 2004
Location: Brooklyn, NY
Posts: 133

Rep: Reputation: 15
I gotta make a bash script so I can easily bring up wifi for home and school with one line.

http://www.tldp.org/LDP/abs/html/

This is a great tutorial.
 
Old 09-01-2004, 01:56 AM   #4
entob
LQ Newbie
 
Registered: Mar 2004
Location: Norway
Distribution: Slackware 9.1
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Lurker01
I gotta make a bash script so I can easily bring up wifi for home and school with one line.

http://www.tldp.org/LDP/abs/html/

This is a great tutorial.
Thanks, i'll have a look at it...
 
  


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
Automating modprobe commands rosspet Linux - Networking 4 08-06-2005 01:09 PM
shell scripting commands and yum= geminigal Linux - Newbie 2 05-13-2005 03:12 AM
automating using shell scripting LinToWinWin Linux - Newbie 1 07-23-2004 09:57 PM
Pause between commands when scripting jwijesundra Linux - General 1 07-03-2004 02:33 AM
automating simple tasks blistfix Linux - Newbie 1 08-20-2001 06:29 AM


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

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