Is your shebang line different from your login shell. Maybe the ! is having unwanted side effects and since your are interested only in files add the -type switch too.
This is my list of sed commands: can anyone tell me where im going wrong. The script works on a file called data which contains 6 student id's and there answers for 6 questions.
!/bin/sh
sed -e 's/*//g' \ #replace * with nothing
-e s/ /X/g' \ #replacing empty space with X
-e... (2 Replies)
Hi guys.
I am trying, to move files found with the find command...
Script runs fine, until it reaches a file that contains spaces...
Here is what i wrote up quickly.
ROOTDIR=/apps/data
SEARCH=$(find /data/HDTMPRestore/home/tmq/ -type f -print | grep Mods/Input/bck | cut -c19-)
for i... (1 Reply)
Hi,
How do you echo something once when a find statement returns null results?
This is when using mutiple locations and mutiple arguments.
The below find command the inner loop of a nested for loop where the outter loop holds the $args and the inner loop holds the locations.
find... (2 Replies)
Hi all!
I've faced with very unintelligible error using find/grep like this:
root@v29221:~# find /var/www/igor/data/www/lestnitsa.ru | grep u28507I get nothing as a result, but:
root@v29221:~# grep u28507 /var/www/igor/data/www/lestnitsa.ru/_var.inc
$db_name = 'u28507';... (2 Replies)
Hi,
Need help with a sed command that I am using to substitute 3 positions of a pipe delimited file.
i am getting different results while substituting the same position of two different files with the same value. Please see details below:
$ cat chk2
... (3 Replies)
Hi Gurus.
This is driving me a bit batty. I now if must be a simple matter but I cant find anything that references it.
I have a housekeeping script that searches for some huge dump directories then removes them using rm -rf.
find ./ -name 'ab' -exec rm -rf {} \;
This works but always... (7 Replies)
Hello,
Hitting a wall on this one. When at the command prompt it works fine:
# find /home/testuser -name 'PAINT*canvasON.txt'
/home/testuser/PAINT_canvasON.txt
# pwd
/home/testuser
# ls -l PAINT*canvasON.txt
-rw-r--r-- 1 root user 23 Feb 07 02:58 PAINT_canvasON.txt... (2 Replies)
Under one of my directories on server I have more than 500 files with different type and name. When I run the find command to list the files with 'ABC_DEFGH' in the begining of its name and older than 20 days, nothing is return as result. Though I know there are more than 400 files which their name... (10 Replies)
Discussion started by: Home
10 Replies
LEARN ABOUT PHP
setuid
SETUID(1) General Commands Manual SETUID(1)NAME
setuid - run a command with a different uid.
SYNOPSIS
setuid username|uid command [ args ]
DESCRIPTION
Setuid changes user id, then executes the specified command. Unlike some versions of su(1), this program doesn't ever ask for a password
when executed with effective uid=root. This program doesn't change the environment; it only changes the uid and then uses execvp() to find
the command in the path, and execute it. (If the command is a script, execvp() passes the command name to /bin/sh for processing.)
For example,
setuid some_user $SHELL
can be used to start a shell running as another user.
Setuid is useful inside scripts that are being run by a setuid-root user -- such as a script invoked with super, so that the script can
execute some commands using the uid of the original user, instead of root. This allows unsafe commands (such as editors and pagers) to be
used in a non-root mode inside a super script. For example, an operator with permission to modify a certain protected_file could use a
super command that simply does:
cp protected_file temp_file
setuid $ORIG_USER ${EDITOR:-/bin/vi} temp_file
cp temp_file protected_file
(Note: don't use this example directly. If the temp_file can somehow be replaced by another user, as might be the case if it's kept in a
temporary directory, there will be a race condition in the time between editing the temporary file and copying it back to the protected
file.)
AUTHOR
Will Deich
local SETUID(1)