I'm trying to pass a filename, or all the files in the current directory to the ls command with a script. Unsuccessful so far, here are a few of my attempts:
#!/bin/ksh
read fname
#if (( $# > 0 )); then
$fname | ls -l
#fi
this produces a long listing of all the files in my current... (4 Replies)
Hi, so Im a bit new to shell scripting and want to do the following but not sure how. Basically I have a file named "output" which contains misc text but inside the file I want to set up variables like $1 or some symbol. Anyways, in another file called "list" I have a list of items that I want to... (11 Replies)
Hi,
I have a script which adds the user credentials to an ldap server. Im passing the variables as below..
/path/my_script $uname $pwd $environ ${deposit}
If i enter some special characters like ';' in $pwd, script returns an error which is set to display if the user enters... (5 Replies)
Hi
I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like
./abc def /file <directory location>
In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after... (4 Replies)
I have a shell script which is invoked by passing an argument. The outer shell script calls another subshell and I want the argument passed down to flow down to the subshell.
E.g
Invoking a shell ======>> abc_refresh.ksh NM
Below is the content of abc_refresh.ksh
Value1=$1... (7 Replies)
I need to pass arguments to a shell script.My batch is calling some java program.
#################
x=$1
y=$2
java -classpath program
###################
if first parameter and second parameter is null then
java -classpath program
if first parameter is not null and second parameter is... (3 Replies)
I have noticed this thing using csh when passing arguments
Suppose I call a csh script using
../Scripts/plot-model.csh -vmod="npt02-z30.vmod" -R="0/80/0/30" -c="0/4.5" -aspr="1:10"
Somehow the " get removed when doing
$argv
ending up with
-vmod=npt02-z30.vmod... (0 Replies)
hi All,
i am trying to pass arguments that contain space , value will be stored in variables to be used further in script , i went thru previous posting , still its not clear to how to implement for my case.
passing 3 args
test.sh it is 'fun to work in unix'
inside shell
... (3 Replies)
I have a script test.sh which reads various inputs from a user.
#!/bin/ksh
read x
read y
read z
echo x: $x y: $y z: $z
# read few more things again
read a
read b
echo a: $a b: $b
When i run this script as
test.sh << EOF
1
2
EOF (3 Replies)
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies
LEARN ABOUT SUNOS
pam_putenv
pam_putenv(3PAM) PAM Library Functions pam_putenv(3PAM)NAME
pam_putenv - change or add a value to the PAM environment
SYNOPSIS
cc [ flag ... ] file ... -lpam [ library ... ]
#include <security/pam_appl.h>
int pam_putenv(pam_handle_t *pamh, const char *name_value);
DESCRIPTION
The pam_putenv() function sets the value of the PAM environment variable name equal to value either by altering an existing PAM variable
or by creating a new one.
The name_value argument points to a string of the form name=value. A call to pam_putenv() does not immediately change the environment. All
name_value pairs are stored in the PAM handle pamh. An application such as login(1) may make a call to pam_getenv(3PAM) or pam_geten-
vlist(3PAM) to retrieve the PAM environment variables saved in the PAM handle and set them in the environment if appropriate. login will
not set PAM environment values which overwrite the values for SHELL, HOME, LOGNAME, MAIL, CDPATH, IFS, and PATH. Nor will login set PAM
environment values which overwrite any value that begins with LD_.
If name_value equals NAME=, then the value associated with NAME in the PAM handle will be set to an empty value. If name_value equals
NAME, then the environment variable NAME will be removed from the PAM handle.
RETURN VALUES
The pam_putenv() function may return one of the following values:
PAM_SUCCESS The function returned successfully.
PAM_OPEN_ERR dlopen() failed when dynamically loading a service module.
PAM_SYMBOL_ERR Symbol not found.
PAM_SERVICE_ERR Error in service module.
PAM_SYSTEM_ERR System error.
PAM_BUF_ERR Memory buffer error.
PAM_CONV_ERR Conversation failure.
PAM_PERM_DENIED Permission denied.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability | Stable |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe with exceptions |
+-----------------------------+-----------------------------+
SEE ALSO dlopen(3C), pam(3PAM), pam_getenv(3PAM), pam_getenvlist(3PAM), libpam(3LIB), attributes(5)NOTES
The interfaces in libpam are MT-Safe only if each thread within the multithreaded application uses its own PAM handle.
SunOS 5.10 1 Mar 2004 pam_putenv(3PAM)