LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Automating simple commands, scripting or programming? (https://www.linuxquestions.org/questions/%2Absd-17/automating-simple-commands-scripting-or-programming-224902/)

entob 08-31-2004 02:40 PM

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! :study:

Crunch 08-31-2004 02:44 PM

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.

Lurker01 08-31-2004 03:50 PM

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.

entob 09-01-2004 01:56 AM

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...


All times are GMT -5. The time now is 08:21 AM.