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
userdel(8)						      System Manager's Manual							userdel(8)

NAME
userdel - Deletes a user login account from the system. SYNOPSIS
SVE: /usr/sbin/userdel [-r] login POSIX: /usr/sbin/userdel [-D] [-r] [-R] [-t type] [-P] [-x extended_option] login OPTIONS
This option is used under enhanced security to delete the user account from /etc/passwd file and the enhanced security protected passwd DB. Removes a user's home directory from the system. This directory must exist and must be owned by the user whose login account is being deleted. When enhanced security is enabled, retires the account without deleting entries from the databases or removing home directories. Removes a local plus (+) or local minus (-) NIS user from the user database. The value of the type parameter can be + or -. Removes PC accounts only, without deleting the user's existing UNIX account. The following extended_option attributes are available: Indicates whether the account is distributed. The value of the distributed=n attribute can be 0 or 1. If set to 0, the account is deleted from the local database. If set to 1, the account is deleted from the NIS master database on the running system. When this attribute is set, the local attribute is set to the opposite value. Indicates whether or not the account is local. The value of the local=n attribute can be 0 or 1. If set to 1, the account is deleted from the local database. If set to 0, the account information is deleted from the NIS master database. When this attribute is set, the distributed attribute is set to the opposite value. The value of the pc_synchronize=n attribute can be 0 or 1. If set to 1, both PC and UNIX accounts will be affected by delete operations. If set to 0, only UNIX accounts will be affected by delete operations and the PC account will be unaffected. Specifies an existing login account on the system. DESCRIPTION
The userdel command is part of a set of command-line interfaces (CLI) that are used to create and administer user accounts on the system. When The Advanced Server for UNIX (ASDU) is installed and running, the userdel command can also be used to administer PC accounts. Accounts can also be administered 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 usermod. 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. If enhanced (C2) security is configured, additional options and extended options can be used. The CLI is backwards-compatible, so all existing local scripts will function. However, you should consider testing your account management scripts before using them. The userdel command deletes a user's login account from the system and makes the login-related changes in the appropriate system files determined by the current level of security. Additionally, the files and directories contained under the user's home directory can be removed from the system. With the -x option, the system administrator can specify whether the user login account to be deleted is local or whether it resides in the NIS master database. If the -x option is not specified, the user login account is deleted from the appropriate database as specified by the system defaults. The default behavior on the system for the userdel command is distributed=0 and local=1. With these values, the system deletes the group from 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. RESTRICTIONS
Note the following restriction that applies to this release: You must have superuser privilege to execute this command EXIT STATUS
The userdel command exits with one of the following values: Success. Failure. Warning. EXAMPLES
The following example removes the local plus (+) user, newuser1: % userdel -t + newuser1 The following example removes the NIS user, newuser4, from the NIS master database: % userdel -x distributed=1 newuser4 The following example deletes the user, xyz, and removes the user's home directory: % userdel -r xyz The following example deletes the UNIX account for studentB, removing the home directory and its corresponding PC account. % userdel -r -x pc_synchronize=1 studentB FILES
The userdel command operates on files for the specific level of system security. SEE ALSO
Commands: groupadd(8), groupdel(8), groupmod(8), useradd(8), usermod(8), passwd(1), Manuals: System Administration, Security, Advanced Server for UNIX Installation and Administration userdel(8)