Help understanding what this ls -l command is checking in a script
Hello,
we have a script that has the two following lines:
I can't understand what these two lines are doing?
When I execute the first line nothing is output. I get that the command is being directed somewhere that is not shown. And when I execute the echo $? line I get a number. Not sure what this number means though? Is this command checking if I can successfully login to this server or not?
Also, is there a way to concatenate the two lines into one command line instruction to return the value?
Thank you.
Last edited by jim mcnamara; 10-09-2019 at 07:37 PM..
We use a UNIX-based system (Lawson) at work and I was given this command to request a data extract from the db admin. The only thing I really understand is the last line as it appears to be joining the files created from the first three lines into one. Is there anyone who can help me breakdown the... (4 Replies)
Guys,
I am trying to understand the sed command here.
adx001 $ a=/clocal/dctrdata/user/dctrdat1/trdroot/recouncil
adx001 $ b=`echo $a | sed 's/\//\\\\\//g'`
adx001 $ echo $b
\/clocal\/dctrdata\/user\/dctrdat1\/trdroot\/recouncil
The sed command i took it from the script.
Please... (3 Replies)
Hi Guys,
I like to know if i have a process which triggers 10 different child processes.
How to identify out of the 11 processes running which is the parent process and what are the child process?
And if i kill the parent process will the child process be killed.. if not is there a way to... (2 Replies)
hi
i was moving a file from one directory to another with the following cmmand
mv /home/hsghh/dfd/parent/file.txt .
while doing so i i accidently
mv /home/hsghh/dfd/dfd .
although i gave ctrl c and terminate the move command some of the file are missing in the parent directory and... (1 Reply)
Hi
I have a questions related 2 commands : 'du' and 'ls'.
Why is the difference between output of 'du' and 'ls' cmd's ?
Command 'du' :
------------------
jakubn@server1 /home/jakubn $ du -s *
4 engine.ksh
1331 scripts
'du -s *' ---> shows block count size on disk (512 Bytes... (5 Replies)
I want to understand what does this command do:confused::confused: find . \( -type f -o -type 1 \) Plz someone explain me ! Thanks much in advance!! (2 Replies)
Hi Friends,
I need a small help in understanding the below sed command.
$ cat t4.txt
1 root 1 58 0 888K 368K sleep 4:06 0.00% init
1 root 1 58 0 888K 368K sleep 4:06 0.00% init last
$ sed 's/*$//' t4.txt
1 root 1 58 0 888K ... (3 Replies)
Dear All members,
i have some trouble here, i want to ask your help. The case is:
I have some data, it's like:
-ABCD1234
-ABCD1235
-ABCD1237
-BCDE1111
-BCDE1112
-BCDE1114
there is some missing data's sequence (the format is: ABCD = name 1234 = sequence).
I want to print the... (2 Replies)
Hello
I am working on a Change request and Stuck at a point. The below awk command is used in the function.
float_test ( ) {
echo | awk 'END { exit ( !( '"$1"')); }'
}
I understand that awk 'END' is used to add one line at the end and exit is used to end the script with an error... (4 Replies)
Hello,
I have a directory where sometimes appear a certain file name - and I'd like to be notified by email when that happens... so what command or script I may use?
e.g. if there's a file named "adam" in the directory named "dir1" then send a mail to "abc@abc.com".. it needs to permanently... (5 Replies)
Discussion started by: netrom
5 Replies
LEARN ABOUT CENTOS
pam_exec
PAM_EXEC(8) Linux-PAM Manual PAM_EXEC(8)NAME
pam_exec - PAM module which calls an external command
SYNOPSIS
pam_exec.so [debug] [expose_authtok] [seteuid] [quiet] [stdout] [log=file] [type=type] command [...]
DESCRIPTION
pam_exec is a PAM module that can be used to run an external command.
The child's environment is set to the current PAM environment list, as returned by pam_getenvlist(3) In addition, the following PAM items
are exported as environment variables: PAM_RHOST, PAM_RUSER, PAM_SERVICE, PAM_TTY, PAM_USER and PAM_TYPE, which contains one of the module
types: account, auth, password, open_session and close_session.
Commands called by pam_exec need to be aware of that the user can have controll over the environment.
OPTIONS
debug
Print debug information.
expose_authtok
During authentication the calling command can read the password from stdin(3).
log=file
The output of the command is appended to file
type=type
Only run the command if the module type matches the given type.
stdout
Per default the output of the executed command is written to /dev/null. With this option, the stdout output of the executed command is
redirected to the calling application. It's in the responsibility of this application what happens with the output. The log option is
ignored.
quiet
Per default pam_exec.so will echo the exit status of the external command if it fails. Specifying this option will suppress the
message.
seteuid
Per default pam_exec.so will execute the external command with the real user ID of the calling process. Specifying this option means
the command is run with the effective user ID.
MODULE TYPES PROVIDED
All module types (auth, account, password and session) are provided.
RETURN VALUES
PAM_SUCCESS
The external command was run successfully.
PAM_SERVICE_ERR
No argument or a wrong number of arguments were given.
PAM_SYSTEM_ERR
A system error occurred or the command to execute failed.
PAM_IGNORE
pam_setcred was called, which does not execute the command. Or, the value given for the type= parameter did not match the module type.
EXAMPLES
Add the following line to /etc/pam.d/passwd to rebuild the NIS database after each local password change:
password optional pam_exec.so seteuid /usr/bin/make -C /var/yp
This will execute the command
make -C /var/yp
with effective user ID.
SEE ALSO pam.conf(5), pam.d(5), pam(8)AUTHOR
pam_exec was written by Thorsten Kukuk <kukuk@thkukuk.de> and Josh Triplett <josh@joshtriplett.org>.
Linux-PAM Manual 09/19/2013 PAM_EXEC(8)