Sponsored Content
Top Forums Shell Programming and Scripting Supress the psswd from ps in ksh/bash Post 302994357 by Don Cragun on Wednesday 22nd of March 2017 01:06:25 AM
Old 03-22-2017
The ps output is not your problem. The problem is that you are passing a cleartext password through a publicly viewable channel.

Instead of passing the password to a process through a command-line argument, pass it through a pipe, pass it through a regular file with restricted access permissions, pass it through a shared memory segment with restricted access permission, ...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ksh vs Bash

Hi Buddy, Can any one help me to overcome from the below problem? #/usr/bin/ksh typeset -Z dd dd=1 echo $dd =========== out put for the above is 01 same script I'm migrating to bash but typeset -Z option is not found in bash, Pls get me the equivalent option in BASH Thanks in... (1 Reply)
Discussion started by: krishna
1 Replies

2. Shell Programming and Scripting

Need help : KSH>BASH

Hello, I've written a script in KSH, but now it needs to run on a system without KSH, ie sh or bash etc, bash seems best bet, but the simplest of things don't seem to work.. The snippet below is the main issue, basically I'm reading from a dat file and putting fields into arrays.. Dat file... (5 Replies)
Discussion started by: itsupplies
5 Replies

3. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

Hi, I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh). The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies

4. Solaris

ksh vs bash

Hi, I've a general question regarding shell. I 've seen that every where i worked in production environment people are using ksh .. but i like to use .. bash .. is there any particular reason why hardcore sysadmins use ksh ? (8 Replies)
Discussion started by: fugitive
8 Replies

5. Shell Programming and Scripting

how to supress the trace

Hi I am working in ksh and getting the trace after trying to remove the file which in some cases does not exist: $ my_script loadfirm.dta.master: No such file or directory The code inside the script which produces this trace is the following: ] || rm ${FILE}.master >> /dev/null for... (3 Replies)
Discussion started by: aoussenko
3 Replies

6. UNIX for Dummies Questions & Answers

bash preferred or ksh with bash features

I'm a user on a fairly locked down sys V server. By default, I have ksh set as my default shell. I added to my .profile: bash -o vi so when I login, it goes into bash so I can take advantage of tab completion and use the up key to bring up previous commands. However, whenever I want to exit, I... (2 Replies)
Discussion started by: mrwatkin
2 Replies

7. Shell Programming and Scripting

ksh vs bash

what is diff between KSH and Bash can you tell me some commands which run in either of two but not in both. while doing normal shell programming I am unable to find diffrence between two (2 Replies)
Discussion started by: pasricha.kunal
2 Replies

8. Shell Programming and Scripting

BASH to KSH

I have a script in KSH and now need to incorporate this into another script which is in BASH. OUr script contains code like below in good number of places. Eg: echo “A B C” | read VAR1 VAR2 VAR3 This works only in ksh and not in BASH. Please let me know 1. Which is the equivalent... (3 Replies)
Discussion started by: cvsanthosh
3 Replies

9. UNIX for Advanced & Expert Users

psswd&shadow 2 passwd together?!!

hi, all I just started on new box where I have to diff passwd working perfectly on the very same account/user. I see that shadow was added recently (I'm not a root in there), I see 'x' in passwd. Not sure how it should work, should I change old passwd for one defined in shadow? Or it's fine to... (20 Replies)
Discussion started by: trento17
20 Replies

10. Shell Programming and Scripting

To Supress *

Hi Team , I want supress the meaning of * while passing it as parameter. I have file which contains file format and destination directory. let say abc* |/home/xyz I had function which will read these values and pass it to another function. Code looks like below func1 () {... (6 Replies)
Discussion started by: gvkumar25
6 Replies
shmop(2)							System Calls Manual							  shmop(2)

NAME
shmat(), shmdt() - shared memory operations SYNOPSIS
DESCRIPTION
attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of the calling process. The segment is attached for reading if (shmflg is "true"; otherwise, it is attached for reading and writing. It is not possible to attach a segment for write only. If the shared memory segment has never been attached to by any process prior to the current call, shmaddr must be specified as zero and the segment is attached at a location selected by the operating system. That location is identical in all processes accessing that shared mem- ory object. Once the operating system selects a location for a shared memory segment, the same location will be used across any subsequent and calls on the segment until it is removed by the operation of See exceptions for MPAS processes below. If this is not the first call on the shared memory segment throughout the system, shmaddr must either be zero or contain a nonzero address that is identical to the one returned from previous calls for that segment. Even if no processes are currently attached to the segment, as long as the segment has been attached before, the same rule applies. See exceptions for MPAS processes below. If the calling process is already attached to the shared memory segment, fails and returns regardless of what value is passed in shmaddr. See exceptions for MPAS processes below. detaches from the calling process's data segment the shared memory segment located at the address specified by shmaddr. Exceptions for MPAS Processes On Itanium(R)-based platforms, MPAS (Mostly Private Address Space) processes are not restricted to passing in zero or a fixed value to calls to MPAS processes may pass in other addresses. The call may fail or succeed due to implementation dependent reasons. MGAS processes have all the restrictions outlined above. In addition, an MGAS process may not assume that it can attach at the address that an MPAS process can use to attach to the same segment. An MPAS process may be able to attach to the same shared memory segment multiple times. Success or failure of such an operation is imple- mentation dependent. Failure will be indicated by a return value of An MPAS process should specify or flags in the call to These follow the same rules as such flags passed to shmget(2). See the for details. RETURN VALUE
returns the following values: Successful completion. n is the data segment start address of the attached shared memory segment. Failure. The shared memory segment is not attached. is set to indicate the error. The symbol is defined in the header No successful return from will return the value returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values. [EACCES] Operation permission is denied to the calling process. [EINVAL] shmid is not a valid shared memory identifier, (possibly because the shared memory segment was already removed using shmctl(2) with or the calling process is already attached to shmid. [EINVAL] shmaddr is not zero and the machine does not permit nonzero values, or shmaddr is not equal to the current attach location for the shared memory segment. [ENOMEM] The available data space is not large enough to accommodate the shared memory segment. [EMFILE] The number of shared memory segments attached to the calling process exceed the system-imposed limit. If fails, is set to one of the following values. [EINVAL] shmaddr is not the data segment start address of a shared memory segment. EXAMPLES
The following call to attaches the shared memory segment to the process. This example assumes the process has a valid shmid, which can be obtained by calling shmget(2). The following call to then detaches the shared memory segment. SEE ALSO
ipcs(1), exec(2), exit(2), fork(2), ftok(3C), shmctl(2), shmget(2), privileges(5). in STANDARDS CONFORMANCE
shmop(2)
All times are GMT -4. The time now is 07:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy