Sponsored Content
Full Discussion: $RANDOM question
Top Forums UNIX for Dummies Questions & Answers $RANDOM question Post 302520834 by methyl on Monday 9th of May 2011 09:51:18 AM
Old 05-09-2011
So do I . Albeit a bit after the fact.
 

10 More Discussions You Might Find Interesting

1. AIX

random in ksh

hello I must to create a ksh script to give a random password with letter, number, and 8 digits. I can't use the random command with ksh, there is a similar command ? thank you (1 Reply)
Discussion started by: pascalbout
1 Replies

2. Shell Programming and Scripting

Random

My problem is as follow and i hope you can help: I currently have this function: stored_word() { number=$RANDOM let "number %= 21" case $number in 0 ) echo "energy" ;; 1 ) echo "touch" ;; 2 ) echo "climbing" ;; 3 ) echo "declare" ;; 4 ) echo "marry" ;; 5 ) echo "relax" ... (8 Replies)
Discussion started by: keyvan
8 Replies

3. Shell Programming and Scripting

Random command

I am trying to select one random word from a file, any ideas on how to do this as i have only manged to generete the random number? (1 Reply)
Discussion started by: melaz
1 Replies

4. Shell Programming and Scripting

$random

I need to use the $RANDOM command to get a line from a list of lines in a file randomly. file is help go three house film how do i randomly get one word without looking into the file? (6 Replies)
Discussion started by: relle
6 Replies

5. Windows & DOS: Issues & Discussions

random RAM question

Random question. 32 bit windows can't address more the 4 gb of RAM, right. So if you have 4gb of “normal” RAM and 1 gb graphics card window only find 3gb of “normal” ram + your graphics card following on from this If you where to put 2 graphics card with 2gb of ram on them each,... (4 Replies)
Discussion started by: THM
4 Replies

6. UNIX for Dummies Questions & Answers

Random fields

Hi, there folks! Well, trying again to build exercises for my students I come across the following idea. Inputfile: csv with two fields (f1 and f2) separated by a tab. Each field contains half a sentence, which added to the one contained in the other field forms a complete sentence (s), so... (2 Replies)
Discussion started by: eldeingles
2 Replies

7. UNIX for Dummies Questions & Answers

random words

Hi there folks, for an exercise for my pupils (you know i am always thinking of them!) i need to randomly re-arrange the words (blank space separated) in a sentence (a line in a textfile). Any inspiration?? Txk so much. (9 Replies)
Discussion started by: eldeingles
9 Replies

8. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

9. Shell Programming and Scripting

Random ordering

1 2 4 5 3 I would like to use a script so that i can randomly rearrange these numbers such as 3 5 2 4 1 Thanks! (3 Replies)
Discussion started by: johnkim0806
3 Replies

10. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies
SETFSGID(2)						     Linux Programmer's Manual						       SETFSGID(2)

NAME
setfsgid - set group identity used for filesystem checks SYNOPSIS
#include <sys/fsuid.h> int setfsgid(uid_t fsgid); DESCRIPTION
The system call setfsgid() changes the value of the caller's filesystem group ID--the group ID that the Linux kernel uses to check for all accesses to the filesystem. Normally, the value of the filesystem group ID will shadow the value of the effective group ID. In fact, whenever the effective group ID is changed, the filesystem group ID will also be changed to the new value of the effective group ID. Explicit calls to setfsuid(2) and setfsgid() are usually used only by programs such as the Linux NFS server that need to change what user and group ID is used for file access without a corresponding change in the real and effective user and group IDs. A change in the normal user IDs for a program such as the NFS server is a security hole that can expose it to unwanted signals. (But see below.) setfsgid() will succeed only if the caller is the superuser or if fsgid matches either the caller's real group ID, effective group ID, saved set-group-ID, or current the filesystem user ID. RETURN VALUE
On both success and failure, this call returns the previous filesystem group ID of the caller. VERSIONS
This system call is present in Linux since version 1.2. CONFORMING TO
setfsgid() is Linux-specific and should not be used in programs intended to be portable. NOTES
Note that at the time this system call was introduced, a process could send a signal to a process with the same effective user ID. Today signal permission handling is slightly different. See setfsuid(2) for a discussion of why the use of both setfsuid(2) and setfsgid() is nowadays unneeded. The original Linux setfsgid() system call supported only 16-bit group IDs. Subsequently, Linux 2.4 added setfsgid32() supporting 32-bit IDs. The glibc setfsgid() wrapper function transparently deals with the variation across kernel versions. C library/kernel differences In glibc 2.15 and earlier, when the wrapper for this system call determines that the argument can't be passed to the kernel without integer truncation (because the kernel is old and does not support 32-bit group IDs), they will return -1 and set errno to EINVAL without attempt- ing the system call. BUGS
No error indications of any kind are returned to the caller, and the fact that both successful and unsuccessful calls return the same value makes it impossible to directly determine whether the call succeeded or failed. Instead, the caller must resort to looking at the return value from a further call such as setfsgid(-1) (which will always fail), in order to determine if a preceding call to setfsgid() changed the filesystem group ID. At the very least, EPERM should be returned when the call fails (because the caller lacks the CAP_SETGID capabil- ity). SEE ALSO
kill(2), setfsuid(2), capabilities(7), credentials(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 SETFSGID(2)
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy