06-04-2001
Thank you very much
Thank you very much. That just saved me a tonne of work
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello All, I am trying to list only directories in my current directory using the command "ls -d". But the output only contains the default directory "." and doesn't list the rest of the directories in the working directory. Can anyone explain why this is happening (2 Replies)
Discussion started by: igandu
2 Replies
2. Shell Programming and Scripting
I have a problem using bash. Simply, I cannot find the right command (if there's one!) to enter in the "- Arch_02 -" directory. As you can see, the name begins with a hyphen and this is causing some trouble:
localhost arch2 # pwd
/mnt/arch2
localhost arch2 # ls -l
total 4
dr-x------ 1 root... (3 Replies)
Discussion started by: robotronic
3 Replies
3. Shell Programming and Scripting
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Discussion started by: swamymns
9 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I would like to know is there any way to find/search filenames or directories inside the directories which has resticted permission.
When we use normal "find" command it returns "permission denied" message for the root directories or directories with restricted permissions.
Thanks (2 Replies)
Discussion started by: forstudy3
2 Replies
5. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
6. Shell Programming and Scripting
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Discussion started by: pstein
5 Replies
7. AIX
Hi
I'm logged in to an AIX box now and we need to do an audit on this box.
cbssapr01:# pwd
/
Which command will show all the files and directories owned by root user with permissions as 777 ? (8 Replies)
Discussion started by: newtoaixos
8 Replies
8. Shell Programming and Scripting
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies
9. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
10. Shell Programming and Scripting
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"
They all returned the match:
./folder/file.pdf
:b:
This find returned no matches:
$ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies
LEARN ABOUT OPENSOLARIS
setegid
setuid(2) System Calls setuid(2)
NAME
setuid, setegid, seteuid, setgid - set user and group IDs
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
int setuid(uid_t uid);
int setgid(gid_t gid);
int seteuid(uid_t euid);
int setegid(gid_t egid);
DESCRIPTION
The setuid() function sets the real user ID, effective user ID, and saved user ID of the calling process. The setgid() function sets the
real group ID, effective group ID, and saved group ID of the calling process. The setegid() and seteuid() functions set the effective group
and user IDs respectively for the calling process. See Intro(2) for more information on real, effective, and saved user and group IDs.
At login time, the real user ID, effective user ID, and saved user ID of the login process are set to the login ID of the user responsible
for the creation of the process. The same is true for the real, effective, and saved group IDs; they are set to the group ID of the user
responsible for the creation of the process.
When a process calls one of the exec(2) family of functions to execute a file (program), the user and/or group identifiers associated with
the process can change. If the file executed is a set-user-ID file, the effective and saved user IDs of the process are set to the owner of
the file executed. If the file executed is a set-group-ID file, the effective and saved group IDs of the process are set to the group of
the file executed. If the file executed is not a set-user-ID or set-group-ID file, the effective user ID, saved user ID, effective group
ID, and saved group ID are not changed.
If the {PRIV_PROC_SETID} privilege is asserted in the effective set of the process calling setuid(), the real, effective, and saved user
IDs are set to the uid argument. If the uid argument is 0 and none of the saved, effective or real UID is 0, additional restrictions
apply. See privileges(5).
If the {PRIV_PROC_SETID} privilege is not asserted in the effective set, but uid is either the real user ID or the saved user ID of the
calling process, the effective user ID is set to uid.
If the {PRIV_PROC_SETID} privilege is asserted in the effective set of the process calling setgid(), the real, effective, and saved group
IDs are set to the gid argument.
If the {PRIV_PROC_SETID} privilege is not asserted in the effective set, but gid is either the real group ID or the saved group ID of the
calling process, the effective group ID is set to gid.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The setuid() and setgid() functions will fail if:
EINVAL The value of uid or gid is out of range.
EPERM For setuid() and seteuid(), the {PRIV_PROC_SETID} privilege is not asserted in the effective set of the calling process and the
uid argument does not match either the real or saved user IDs, or an attempt is made to change to UID 0 and none of the existing
UIDs is 0, in which case additional privileges are required.
For setgid() and setegid(), the {PRIV_PROC_SETID} privilege is not asserted in the effective set and the gid argument does not
match either the real or saved group IDs.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
Intro(2), exec(2), getgroups(2), getuid(2), stat.h(3HEAD), attributes(5), privileges(5), standards(5)
SunOS 5.11 20 Jan 2003 setuid(2)