Subj : Re: Basic script help To : Avon From : hyjinx Date : Sat Aug 14 2021 05:24 pm You can use functions in bash scripts, much more powerful, yet easy to use you simply define them at the start of the script as so: #!/bin/bash functionname() { things } and you call it with the name of the function wherever you like in the script as follows: functionname $VAR1 $VAR2 if you want to pass it any variables, that is. Note that inbuilt vars $1 and $2 etc are the first and second command-line arg, so you can also make your script do interesting things depending upon what arguments you call... eg suppose you have a script called arg.sh: #!/bin/bash if [ -z $1 ] then echo "Your first command was $1" else echo "You didn't enter an argument on the command line. Bye" fi if [ $1 = "foo" ] echo "Ah, I see that $1 was foo. Wonderful!" fi if you run it at the cmldine you get: $./arg.sh foo you'll get two lines of output - saying your first command was foo, then the second echo. Anyway, you get the drift. Hope this helps. Al. hyjinx // Alistair Ross Author of 'Back to the BBS' Documentary: https://bit.ly/3tRINeL (YouTube) alsgeeklab.com --- Mystic BBS v1.12 A46 2020/08/26 (Linux/64) * Origin: Al's Geek Lab -=- bbs.alsgeeklab.com:2323 (21:1/126) .