Im trying to code some logic into a test script to test for the existence of a file before recreating it. Im using the following line to test for this:
if -r test.txt;
However I get the error message
./testScript.sh: -r: not found
Having read through the man pages im still not clear whats... (2 Replies)
I have tried few examples in the internet but all of them are different and none worked. I need to check if a file exists in a directory if it does not then exit . here is what I have for now
$filename ="/usr/local/net/var/lib/directoryservice/sync.disable"
if ;
then
echo "The file exists"... (2 Replies)
Hi friends..
I hav a problem....
I dont know how to check .c files exists r not in a folder using IF in C shell script
actually i tried like this
if(=~ *.c)
even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
Hi All,
working on AIX 5.3.
Requirement is:
Shell script in ksh to check if any file exists in 4 folders as below:
1. /FILE/INB/INT1
2. /FILE/INB/INT2
3. /FILE/INB/INT3
4. /FILE/INB/INT4
Thanks a lot for your time!
a1_win. (3 Replies)
Hi,
I'm new to UNIX, at least shell programming and am having trouble figuring out a problem i'm having. In one section in my nested if statement, i want the program to test if the file does not exist, based on an argument supplied at the command line by the user. What i have is
elif ; then... (3 Replies)
Hello!
I'm stuck with a problem that i can't solve. I'm very new to unix, linux and shell scripting i might add. I'm trying to create a script that will execute as follows:
First start the script - sh exist
Then the prompt asks the user to input a username to check if it exists within the... (6 Replies)
Hi, I'm new to C Shell programming. I'm trying to check if a sym link exists on remote server if not send email. I'm not having much luck. Can anyone help?
Here is what I have written but it doesn't work. It tells me that my variable was not defined. Here is part of the script, the second... (0 Replies)
Hi Folks,
Trying to build up a script that will lookup a username invoked as:
./buildscript.sh <username>
This should take <username> and look it up in <username_file> and prepare for further processing. Here is the snippet that isn't working just right:
user=$1
if ]; then
echo... (1 Reply)
Hi,
I am Searching for Multiple strings in a given date range and print the Group if they exists. the below is the format:
-------------------------------------------------------------------------------------------------------------------------
ID: FIRST ID
MESSAGE: Event Message... (5 Replies)
Discussion started by: linuxuser999
5 Replies
LEARN ABOUT PHP
posix_setgid
POSIX_SETGID(3) 1 POSIX_SETGID(3)posix_setgid - Set the GID of the current processSYNOPSIS
bool posix_setgid (int $gid)
DESCRIPTION
Set the real group ID of the current process. This is a privileged function and needs appropriate privileges (usually root) on the system
to be able to perform this function. The appropriate order of function calls is posix_setgid(3) first, posix_setuid(3) last.
Note
If the caller is a super user, this will also set the effective group id.
PARAMETERS
o $gid
- The group id.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
posix_setgid(3) example
This example will print out the effective group id, once it is changed.
<?php
echo 'My real group id is '.posix_getgid(); //20
posix_setgid(40);
echo 'My real group id is '.posix_getgid(); //40
echo 'My effective group id is '.posix_getegid(); //40
?>
SEE ALSO posix_getgrgid(3), posix_getgid(3).
PHP Documentation Group POSIX_SETGID(3)