10-07-2005
cpio in shell called from php
I have a php program that calls a shell script, this part works fine and most of the commands work. However, I have a cpio command in the shell script, and for some reason this doesn't work. If I catch the return code, it's 1 which means it terminated with an error, but I get no other indication of an error in php or the shell. Has anyone done this before?
I'd really appreciate any help I can get.
Monica
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm puzzled by this one. I hope you can explain it to me.
I have a ksh shell script that gzips a file among other things. This works perfectly fine when the script is manually run through a shell. However, when the same script is run through cron, it does everything correctly, but it will... (2 Replies)
Discussion started by: hbau419
2 Replies
2. Shell Programming and Scripting
I have a ksh script that connects to sqlplus and dumps the query results into a file. The script works file when I run it from the command line, however, when I call it from PHP using system(), exec(), or shell_exec() commands, the script doesn't seem to run the query. It will create the text file... (7 Replies)
Discussion started by: j2owilson
7 Replies
3. UNIX for Dummies Questions & Answers
There are two files one is shell script (sample.sh) and another is configuration file (sampl_conf.cfg)
configuration file contains one variable $FTP_HOME. the value of this variable vaires for user to user. If user is say jadoo then value is /home/jadoo/ftp/, for user1 - /home/user1/ftp. The... (4 Replies)
Discussion started by: jadoo_c2
4 Replies
4. HP-UX
:wall:What is this shell called ?
"/sbin/sh"
When I run "echo $SHELL" command on my HP-UX,I get above output.
In Linux It was "/bin/bash". Which is bash shell. (5 Replies)
Discussion started by: manalisharmabe
5 Replies
5. UNIX for Advanced & Expert Users
I'm trying to call shell scripts from Java for DB operations. Using a very simple test, for some reason, one line of (ALTER TABLE) in the shell simply won't be executed while the exit value from the call is "0" (valid exit). When I run the script directly in Unix, it gets executed perfectly fine!!... (4 Replies)
Discussion started by: zmwang
4 Replies
6. Shell Programming and Scripting
Hi All,
I have a file which sets all the variables on unix , based on the hostname. Currently these variables are hardcoded in the cobol programs.I was wondering if unix variables can be used in Cobol programs ?
Example :
I have a variable $SHTEMP which is set based on the following :
Prod... (2 Replies)
Discussion started by: nua7
2 Replies
7. UNIX for Dummies Questions & Answers
We have a program source C and is required to indicate how many times each function is called from the C program. also print the line number where there is a call.
I've tried something like this:
#!/bin/sh
for i in $*;do
if !
then
echo $i is not a C file.
else echo $i... (0 Replies)
Discussion started by: oana06
0 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I am calling a series of shell scripts via CRON so everything is running as root. However, in my error log file I am seeing the following errors. Please can anyone offer any advise as to the possible causes and solution to prevent the errors from appearing.
The Error 1227 seems to... (2 Replies)
Discussion started by: daveu7
2 Replies
9. Shell Programming and Scripting
Hello! Im trying to create a shell script that will be executed by PHP like:
$return = shell_exec("./makeUser.sh $user $pass");
My shell script looks like:
#!/bin/bash
NAME=$1
PWD=$2
pass=$(perl -e 'print crypt($ARGV, "password")' $PWD)
useradd -m -p $pass $NAME
&& echo "0" ||... (2 Replies)
Discussion started by: blak422
2 Replies
10. UNIX for Advanced & Expert Users
Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: )
For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies