Sponsored Content
Full Discussion: Passing Variables
Top Forums Shell Programming and Scripting Passing Variables Post 302866373 by balajesuri on Monday 21st of October 2013 11:05:13 PM
Old 10-22-2013
Code:
[user@host ~]$ DAY1=10202013
[user@host ~]$ COUNT=1
[user@host ~]$ eval DATE=\$DAY$COUNT
[user@host ~]$ echo $DATE
10202013
[user@host ~]$

This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing Variables to AWK

Does anybody have an explanation for the following: The following scripts runs fine on IRIX64 6.5 but has bugs on Solaris 8. #! /bin/sh echo run only on an SGI machine echo type in linenumber read j echo value read value awk -f rmspass2 level=$value $j'step1.mlf' When the script is... (5 Replies)
Discussion started by: AreaMan
5 Replies

2. Shell Programming and Scripting

passing variables

Hi, Is there any way to pass variable to a sed script.For awk we have -v option.like that do we have any way to pass variable to a sed script from a awk script or from normal script? Thanx, sounder (1 Reply)
Discussion started by: sounder123
1 Replies

3. Shell Programming and Scripting

Passing variables to sed

Hi Folks, How can I make the following to work from a korn shell? old="OLDSTRING" new="NEWSTRING" file="myfile.txt" sed -n 's/$old/$new/gp' $file Thanks in advance rogers42 (3 Replies)
Discussion started by: rogers42
3 Replies

4. Shell Programming and Scripting

Passing string variables

HI all, Very new to shell programming and just wanted some help on how to solve the following problem. I have a small shell script which searches a given file and extracts some string parameters. I want to now be able to call this script from another shell script and somehow pass the parameters... (11 Replies)
Discussion started by: pxy2d1
11 Replies

5. Shell Programming and Scripting

Passing 2 variables

Hi All, I need to pass 2 variables name 'vamskt' and 'vamsi'. Here is my question: delete from gpi.usergroup where usg_user_id in ('vamskt'); delete from gpi.userroles where uro_user_id in ('vamskt'); delete from gpi.user where usr_id in ('vamskt'); insert into gpi.user... (3 Replies)
Discussion started by: tvamsikiran
3 Replies

6. Shell Programming and Scripting

Passing two variables to function

HI ,I am a new in Bash and ,I dont know how to pass a second parameter to this fuction,if the name of the passed argument is num works fine,but if I try to pass secondNum,dont recognized it thanks function check() { if(($(echo ${#num}) == 0 )) then echo No arguments passed.Try... (6 Replies)
Discussion started by: lio123
6 Replies

7. Shell Programming and Scripting

Passing variables and setting them

So I'm writing a script to generate pairwise scores for how similar two strings are, and while I've been able to get it to work on a single script, I've been unable to iterate it. So suppose I have a file thus 1234567890 1234567890 1234567899 first I need to assign two lines, by their... (3 Replies)
Discussion started by: viored
3 Replies

8. Shell Programming and Scripting

Procedure not passing variables

Hi all, I just started some basic Perl programming and have been experimenting with some basic commands and bumped into and issue. Basically, I have a procedure which retrieves a list of names from a file named file. Then the program asks the user to enter a name and compares it to the list... (2 Replies)
Discussion started by: dsaliba
2 Replies

9. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

10. Shell Programming and Scripting

Passing variables from one script to another

Hi, this is the example i'm trying to do. script1.sh ABC="test.txt" ./script2.sh "$ABC" script2.sh INPUT="$HOMEDIR/$ABC" echo $INPUT when i run the 1st script it gives me ../home/ the test.txt is not passed into 2nd script. How can i resolve this. (2 Replies)
Discussion started by: gskris88
2 Replies
innetgr(1)							   NSS utilities							innetgr(1)

NAME
innetgr - Check netgroup membership SYNTAX
innetgr [-d domain] [-h host] [-u user] [-v] <netgroup> DESCRIPTION
innetgr checks if the specified user, host or domain is a member of the given netgroup. The program does not produce any output unless the verbose ( -v ) flag is given. The exit status is 0 if the user/host/doman combination is a member of the given netgroup. Exit status is 1 if the combination is not found in the group, and 2 if one of the arguments are invalid. OPTIONS
--domain <domain> | -d <domain> Search in the given domain. --host <host name> | -h <host name> Search for the given host name. --user <user name> | -u <user name> Search for the given user name. --verbose | -v Enable verbose mode --version | -V Show version information. EXAMPLES
To check if the current host is listed in the netgroup allhosts, use this command line: if innetgr -h `uname -n` allhosts ; then echo "Found"; fi CONFORMING TO
A innetgr program first appeared in NetBSD 1.4. AUTHORS
Petter Reinholdtsen <pere@hungry.com> SEE ALSO
getent(1) netgroup(1) innetgr(3) netgroup(5) nsswitch.conf(5) Petter Reinholdtsen 0.7 innetgr(1)
All times are GMT -4. The time now is 06:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy