Need to call a function with arguments


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to call a function with arguments
# 8  
Old 12-17-2013
And as an addendum to RudiC's post be aware of this:-

When is a _function_ not a _function_? | Unix Linux Forums | UNIX for Advanced & Expert Users

Note: There are no braces...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call same function using 2 different arguments

I have a script that uses 2 arguments. I want to call the function part within this script using these same arguments. Below is what I came up with below script so far, any guidance would be helpful. Thank you! cat backup.sh #!/bin/bash function usage { echo "USAGE: $(basename $0)... (6 Replies)
Discussion started by: mbak
6 Replies

2. Shell Programming and Scripting

How to call Oracle function with multiple arguments from shell script?

Dear All, I want to know how can i call oracle function from shell script code . My oracle function have around 5 input parameters and one return value. for name in *.csv; do echo "connecting to DB and start processing '$name' file at " echo "csv file name=$x" sqlplus -s scoot/tiger <!... (2 Replies)
Discussion started by: Balraj
2 Replies

3. Shell Programming and Scripting

How to funnel stdout into call arguments?

This command successfully gives me the clearcase views I want in stdout, one line per view name. Each view name appears to have no spaces. cleartool lsview | grep -i `uname -n` | grep -v "ViewStorage\\|vgr_tools_sv" | cut -f 3 -d ' ' How can write a cygwin bash "for" loop that will iterate... (4 Replies)
Discussion started by: siegfried
4 Replies

4. Shell Programming and Scripting

After exit from function it should not call other function

Below is my script that is function properly per my conditions but I am facing one problem here that is when one function fails then Iy should not check other functions but it calls the other function too So anyone can help me how could i achieve this? iNOUT i AM GIVING TO THE... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

5. Shell Programming and Scripting

bash read within function with arguments

I have trouble getting this logic to work #!/bin/bash function assign_var(){ while do read -p "$2 :" $3 done } assign_var '$IPADDRESS' ipaddress IPADDRESS Basicly, i want to make sure that entry is made (i can add more sophisticated checks later), but the idea is to recycle... (11 Replies)
Discussion started by: serverchief
11 Replies

6. UNIX for Dummies Questions & Answers

write() system call arguments

Hi, I'm trying to understand the arguments from this system call, can someone help me figure it out? write(1, "/home/nick/11sp/fred\n", 27/home/nick/11sp/fred) = 27 for argument 1, i know it is a file descriptor which specifies standard output. Argument 2, i believe is "what is to be... (4 Replies)
Discussion started by: l flipboi l
4 Replies

7. Shell Programming and Scripting

cat arguments to a function

Hi, I've a logging function in bourne shell, flog() which logs the first argument passed to it. How can I pass arguments to this function from a file, like cat filename | sed '...filtering...' | flog or cat filename | sed '...filtering...' | xargs flog Which did not work, after which... (3 Replies)
Discussion started by: Random_Net
3 Replies

8. Shell Programming and Scripting

How to call arguments with variable in a script??

Hello, I was wondering if it were possible to call arguments passed to a script using a variable. For example: sh script.sh yes no good bad x=$# while do echo (last argument, then second last etc until first argument) let x=($x-1) done should print out bad good no (4 Replies)
Discussion started by: VanK
4 Replies

9. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

10. Programming

can we send arguments to system() call

Hi friends my C code is int main() { system("cp <source> <destination>"); } my question is how to set variables for <source> and <destination> how can we pass it to system() call. can you suggest me thankyou kingskar (6 Replies)
Discussion started by: kingskar
6 Replies
Login or Register to Ask a Question
groupadd(8)						      System Manager's Manual						       groupadd(8)

NAME
groupadd - Adds a new group definition SYNOPSIS
/usr/sbin/groupadd [-g gid [-o]] [-P] [-x extended_option] group_name OPTIONS
Specifies the group identifier (GID) of the new group being added. The GID must be a non-negative decimal integer. Allows a group identi- fication (GID) number to be duplicated (non-unique). This option can be used only with the -g option. Creates a PC group only. The fol- lowing extended_option attributes are available. The PC attributes will only be applicable if the Advanced Server for UNIX (ASU) is config- ured. The extended_option attributes can be specified as a space-delimited list after a single -x option. Indicates that the group is distributed. The value of the distributed=n attribute can be 0 or 1. If set to 0, the group is added to the local system. If set to 1, the group is added to the NIS master database on the running system. When this attribute is set, the local attribute is automatically set to the opposite value. Indicates that the group is local. The value of the local=n attribute can be 0 or 1. If set to 1, the group is added to the local database. If set to 0, the group information is added to the NIS master database. When this attribute is set, the distributed attribute is automatically set to the opposite value. A comma-delimited list of members that will be added to the UNIX user's group. You can specify the user (login) name or the account UID. Specifies a text string that provides a description of the PC group. Specifies a comma delimited list of PC users to be added to the current list of members of a PC group. Note that this adds, but does not replace mem- bers. Specifies the name of the new group. The group name can be any printable characters, with the exception of the colon (:) and new- line ( ) characters. DESCRIPTION
The groupadd command is part of a set of command-line interfaces (CLI) that are used to create and administer user groups on the system. When the Advanced Server for UNIX (ASU) is installed and running, the groupadd command can also be used to administer PC groups for users who are also holders of Windows NT domain accounts. Accounts can also be created with the /usr/bin/X11/dxaccounts graphical user interface (GUI), although the extended options are only available from the CLI utilities such as useradd and groupmod. Different options are available depending on how the local system is configured: In the default UNIX environment, user account management is compliant with the IEEE POSIX Draft P13873.3 standard. The CLI is backwards-compatible, so all existing local scripts will function. However, you should consider testing your account management scripts before use. The groupadd command lets the system administrator create new groups on the system, by specifying the group name and GID. When the GID is not specified (with the -g option), the GID defaults to the next available (unique) number. The -x option lets the system administrator specify whether the new group is local or distributed over a network. If this option is not specified on the command line, the system adds the new group to the appropriate database as specified by the system defaults. The default behavior on the system for the groupadd command is distributed=0 and local=1. With these values, the system adds the group to the local database by default. Setting the distributed= and local= attributes to the same value (for example, distributed=0 and local=0) produces an error. You must have superuser privilege to execute this command. RESTRICTIONS
You cannot specify more than 255 characters on a single command line. However, lines can be split to an appropriate length. If you try and enter too many new groups, the group file may be corrupted. The pc_synchronize default value is not used for groupadd, groupmod, and groupdel. UNIX and PC groups cannot be synchronized and therefore must be created separately. Use the command groupadd -P xdomain to create a PC group named xdomain. Then, use the command groupadd xdomain to create a UNIX group named xdomain. EXIT STATUS
The groupadd command exits with one of the following values: Success. Failure. Warning. EXAMPLES
The following example adds the group, newgroup, to the group database with a system-provided GID: % groupadd newgroup The following example adds the group, newgroup, to the group database with a GID of 451: % groupadd -g 451 newgroup The following example adds the group, new- group, to the NIS master database % groupadd -x distributed=1 newgroup The following example adds the PC group, projectX with members JoeMc and HiteshC: % groupadd -x members=JoeMc,HiteshC, projectX The following example adds the PC group, newgroup and provides a description field "common project group": % groupadd -P -x pc_group_description="common project group" projectX FILES
The groupadd command operates on files for the specific level of system security. SEE ALSO
Commands: groupdel(8), groupmod(8), useradd(8), userdel(8), usermod(8) System Administration Security Advanced Server for UNIX administration and configuration documents. groupadd(8)