10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
While I am trying to check the filename/s in IF statement of a shell script (RedHat Linux 6) I am getting below error:
filename_time2=`date --date='yesterday' +%Y-%m-%d`
cp server.log-$filename_time2* ../archive/new... (5 Replies)
Discussion started by: Dip
2. Shell Programming and Scripting
Linux System having all Perl, Python, PHP (and Ruby) installed
From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file
a Shell script run in a case statement call to run a php file, also Perl or/and Python file???
case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
3. Shell Programming and Scripting
I need to run a local shell script on a remote machine. I am able to achieve that by executing the command
> ssh -qtt user@host < test.sh
However, when I try to pass arguments to test.sh it fails.
Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
4. Shell Programming and Scripting
I have a shell script that takes 2 arguments. I will have to execute this script multiple times with different values for the arguments.
./shscript env1 value1
./shscript env1 value2
./shscript env2 value3
./shscript env3 value4
./shscript env1 value5
./shscript env3... (24 Replies)
Discussion started by: goddevil
5. Shell Programming and Scripting
Is it possible to dry run a php script without actually executing it? Say I need to test the output of a php file to see if it matches a pattern. I need to run this on all php files on the server. But I fear if there are php files that make modifications, sends out mail etc, that should not happen.... (1 Reply)
Discussion started by: anilcliff
6. Shell Programming and Scripting
can anyone post a sample showing a way to parse a variable containing a string to a .exe file .
Venu (2 Replies)
Discussion started by: venu
7. Shell Programming and Scripting
I have two types of files in a directory:
I have a perl script that uses these two files as arguments, and produces a result file:
perl myScript.pl abc.txt abc.xml
How can I run this script (in a "for" loop , looping through both types of files)... (4 Replies)
Discussion started by: ad23
8. UNIX for Dummies Questions & Answers
I am looking to build a monitoring script.
The script should always run as a system service of some type and should always check that a PHP script is running.
Maybe there is a way to assign a PHP script to a certain PID so that the monitor script that check for the PID in top... (4 Replies)
Discussion started by: elDeuce
9. Shell Programming and Scripting
I have written a code for uploading a file onto the server.The code is as follows:
<? if ($_POST == "Upload File")
if( move_uploaded_file ($_FILES ,$target) )
$tmpsrc = $_FILES ;
echo... (2 Replies)
Discussion started by: michrods
10. Shell Programming and Scripting
I write a shell script for import data to oracle using sql loader.
I set permission 755 or 777 for that script. I can run that script in the consol okay.
When I call it from PHP using system command. I got return value 126 this value when don't have permission right ?
I check step... (2 Replies)
Discussion started by: raccsdl
escape(1) Mail Avenger 0.8.3 escape(1)
escape - escape shell special characters in a string
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
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
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:
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"
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
bodytest reject_bcc `escape "$RECIPIENT"`
The Mail Avenger home page: <http://www.mailavenger.org/>.
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
Mail Avenger 0.8.3 2012-04-05 escape(1)