Re: Shell script function problems
At 07:27 PM 2/8/2008, you wrote:
phillinux wrote:
I'm trying to write a bash shell script to create user accounts 
that calls 2 functions. I can't call these functions from the 
script or the command line. The set command seems to show the 
loaded script in the shell (loaded with . FunctionName at command 
line) with other environmental variables. ALSO: The type command 
does not recognize the function.
The script and functions work on my laptop running Fedora (with one 
small glitch). Is there something I can do to my Debian server to 
get functions recognized??
Are these functions by chance fedora specific? Or are they built 
into your shell script?  How are you loading them into your script?
Thx,
Jeff
I'm still testing, so load the functions at the command line before I 
run the script.  I load it by typing:
. File_Name       (dot, space File_Name)
One function is a recursive script that is called when a duplicate 
user name is found on the system.  It appends a number on the end and 
keeps checking and appending until a unique name is found.  I read 
that a function is the only way to make a script recursive.
The other function creates the user and password calling useradd and 
passwd and here files.
I tested it on my Fedora laptop and kit works,  Each function exists 
in a separate file,  all files are in the same directory.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a 
subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: