01-19-2011
Knowing the user who is executing my script
Hi, is there any way? I thot of id but it doesnt work quite well
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hey peeps
i am pretty much new to unix, my first semester at uni, so if anyone can help, would be greatly appreciated.
how the hell is it possible for a user to execute priveleged commands without the user having a superuser password??
if anyone can help me, i would appreciate it very... (2 Replies)
Discussion started by: 30177005
2 Replies
2. AIX
HI,
Do we have a command in AIX which will let us know when is the user id password getting expired!!
Any advice will be of great help!!
Thanks,
Siddharth (0 Replies)
Discussion started by: siddhhuu
0 Replies
3. Shell Programming and Scripting
Hi,
I want to execute a script - of different user from my script.
I have tried the su command
su - username -c "scriptname"
it works but asked for password.
Is there any way for supplying the password to it thru script, not interactively.
Or is there any other way to achieve the... (5 Replies)
Discussion started by: yeheyaansari
5 Replies
4. UNIX for Dummies Questions & Answers
How do i in a script determine the user that is executing it? (2 Replies)
Discussion started by: Chiefos
2 Replies
5. SCO
I need to regular users to be able to launch a script which does something requiring root privilages. I've tried using chmod 4755 which gives it
-rwsr-xr-x permissions but it still can not be run as the regular user. (1 Reply)
Discussion started by: checkpro
1 Replies
6. Shell Programming and Scripting
Hello,
I'm running a perl script to execute a program through my Unix command line. The program requires a user input but I want to automatically have perl input the string. Is there a way to do this?
Thanks (1 Reply)
Discussion started by: leonard2352
1 Replies
7. Shell Programming and Scripting
Hi All,
I am executing a Tcl script and i am trying to get the user input while they execute the script at start itself like
>>filename.tcl USERINPUT
and then i will take this userinput inside the the tcl assign it to some variable for further manipulation/processing ...... can anyone pls... (1 Reply)
Discussion started by: sukrish
1 Replies
8. Shell Programming and Scripting
Hi,
I am writing a switch case statement and one of the option contains sudo to a particular user and then perform some steps after that but my script is unable to proceed with further execution after doing sudo over the user. Could you please suggest an workaround for this. (1 Reply)
Discussion started by: adityam
1 Replies
9. UNIX for Dummies Questions & Answers
hi,
i want to execute a shell script as a different user. the flow is like this.
there is a html web page from which i have to call a shell script. web server is apache. to call the shell script from html page, a perl script is required.
so the html page calls the perl script and the perl... (2 Replies)
Discussion started by: Little
2 Replies
10. UNIX for Dummies Questions & Answers
hi
how to restrict a user ro run rm command.
In this scenario we have a user/group has below in sudoers
user ALL=(ALL) ALLis there a way to restrict the user from just executing rm command (9 Replies)
Discussion started by: robo
9 Replies
LEARN ABOUT FREEBSD
escape
escape(1) Mail Avenger 0.8.3 escape(1)
NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO
avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)