Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-23-2004, 11:04 AM   #1
Registered: Apr 2004
Posts: 14

Rep: Reputation: 0
Good scripting practices?

Hi, I'm new to linux and bash scripting.

I'm trying to write a quite large and complex script(s), and seperating some commonly used functions etc. in own files seems like a good idea. What is good programming practice here?
Old 04-23-2004, 12:56 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Welcome to LQ.

You can define a function with:
# This is ""
myfunction() {
  echo My Function
To load it in another script with:
# This is ""

# Load the function
. /path/to/

# Run the function
Old 04-26-2004, 10:55 PM   #3
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
You may find the Advanced Bash Scripiting Guide useful...


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
Good practices as programmer interview candidate? lowpro2k3 Programming 3 10-21-2005 02:15 PM
Partitioning: Best Practices newtype Linux - General 2 06-05-2004 07:44 AM
Best practices for upgrading hyper guy General 5 05-28-2004 12:39 AM
Seeking for a good scripting language... Frank Programming 11 01-02-2004 10:35 PM
Best Practices mooreted Linux - Software 4 06-12-2003 12:31 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration