[support] passing vars

Ken Robinson kenrbnsn at rbnsn.com
Sun Jun 28 01:03:41 UTC 2009


You have a few problems:

1) your PHP needs a space in the command
$username = 'foo';
Exec('/root/test.sh ' . $username);

2) your shell script you need
Echo $1

Ken

------Original Message------
From: aurfalien at gmail.com
Sender: support-bounces at drupal.org
To: support at drupal.org
ReplyTo: support at drupal.org
Subject: [support] passing vars
Sent: Jun 27, 2009 5:41 PM

Hi,

Please excuse this seemingly retarded mail.

While fun, PHP is more then 4 handfuls and I only have 2.

An example php script;

$username = foo;
exec('/root/script.sh'.($username));

My script.sh file;

#!/bin/tcsh
mkdir /root/$username


When I execute my PHP script, I get this;

sh: /root/script.shfoo: No such file or directory

I was hoping to pass the PHP var of $username to mkdir in the tcsh  
script and make a directory called /root/foo.

I don't understand whats going on.

Any ideas?

- aurf
--
[ Drupal support list | http://lists.drupal.org/ ]


Sent from my Verizon Wireless BlackBerry


More information about the support mailing list