Variable not an identifier when script is run as another user
I am new to scripting
I keep getting the error var2= is not an identifier when I run this script as another user. BUT when I run it as myself, the script completes without error. Any idea why? I assume it is because the new user has a different environment . How do I make the variables active for this new user? I don't have setenv and I've already exported them. As I said, the script works fine until i run it after logging in and running su - newuser to change to the newuser. I wish I could fix this so the newuser could also run the script.
Any ideas would be helpful to a newbie, thanks!
Last edited by vbe; 11-29-2012 at 12:26 PM..
Reason: You insert your code in between the code tags! I revamped you code for reading...
Hi,
I have a script A.run which will call B.run.
How can i run B.run with a common id instead of using my login id?
I have tried as below, in Script A.run :
.........
echo "Running B.run......"
rsh -l commonid hostname B.run
.........
but it's give me "Permission Denied".......
... (3 Replies)
Hi all,
I'm a newbie to the Linux world.
I have a script that needs to run under "UserB". But I don't want to give out the password to UserB. Is there a way to setup the script to run as "UserB" when UserA runs it.
Thanks in advance for your assistance. (1 Reply)
Hello Experts
I want to run script from another user in unix . Also the script
has been calling from SQL. HOST command helps to call the unix file
from sql . But my problem is the unix script has to be run by
another user.
I tried tht following
$ sudo su - user2 -c who... (4 Replies)
Good morning. I am searching for "how-to"'s for some particular questions:
1. How to write a script in HP-UX 11.
2. How to schedule a script.
3. How to "call" scripts from the original script.
4. How to su to another user from within a script.
This is the basics of what the... (15 Replies)
Guy's
I have script to start the data base and this script need to be excited by Oracle user
Is there any command to be excited by root and to run this script Start_Oracal_DB.sh by Oracle user
Pls Advice …
Excessive formatting removed.
I have told you so on several occasions now and... (2 Replies)
hello all
There are files on host1 which need to sftp'd to host2 everyday. user 'yyy' has his dsa keys set up on host 1 and host 2 . If user 'yyy' executes the below query without 'su' part, then all files are transferred.
Now user 'xxx' wants to run the script and transfer the files, but he... (5 Replies)
Dear all,
i am doing an SVN backup script. Almost done.
My problem is :
Script should run by user : svn
There is a chance to run the script by root itself.. so i coded like following
#This script path and name ... (2 Replies)
Hi
I have a script that i would like to be run by a different user.
For example, I have a file called 'mytest.pl' created by user 'user4'
What command should i use to make sure that user 'ydanial' has ability to run 'mytest.pl' ?
Thanks (6 Replies)
I have a script ( the name is /tmp/script1) , the content is simple , just copy a file to another directory .
Now I would like every user will change to a specific user ( eg. userA ) before run this script so that the script will be run by userA , that mean I want only userA run this script , I... (2 Replies)
Hi,
Can anyone help me write a script tp determine the web browser from a user agent. A user agent is stored in a file and consists of hundreds of lines e.g.
37050 Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
29404 Mozilla/5.0 (Windows NT 6.3; WOW64)... (4 Replies)
Discussion started by: cyberfrog
4 Replies
LEARN ABOUT PHP
output_add_rewrite_var
OUTPUT_ADD_REWRITE_VAR(3) 1 OUTPUT_ADD_REWRITE_VAR(3)output_add_rewrite_var - Add URL rewriter valuesSYNOPSIS
bool output_add_rewrite_var (string $name, string $value)
DESCRIPTION
This function adds another name/value pair to the URL rewrite mechanism. The name and value will be added to URLs (as GET parameter) and
forms (as hidden input fields) the same way as the session ID when transparent URL rewriting is enabled with session.use_trans_sid. Please
note that absolute URLs (http://example.com/..) aren't rewritten.
This function's behavior is controlled by the url_rewriter.tags php.ini parameter.
Note
Calling this function will implicitly start output buffering if it is not active already.
PARAMETERS
o $name
- The variable name.
o $value
- The variable value.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
output_add_rewrite_var(3) example
<?php
output_add_rewrite_var('var', 'value');
// some links
echo '<a href="file.php">link</a>
<a href="http://example.com">link2</a>';
// a form
echo '<form action="script.php" method="post">
<input type="text" name="var2" />
</form>';
print_r(ob_list_handlers());
?>
The above example will output:
<a href="file.php?var=value">link</a>
<a href="http://example.com">link2</a>
<form action="script.php" method="post">
<input type="hidden" name="var" value="value" />
<input type="text" name="var2" />
</form>
Array
(
[0] => URL-Rewriter
)
SEE ALSO output_reset_rewrite_vars(3), ob_flush(3), ob_list_handlers(3).
PHP Documentation Group OUTPUT_ADD_REWRITE_VAR(3)