Programming :: Getting Shell Script To Execute IF New Row In Postgres SQL Is Added?

Mar 17, 2009

I do not want to use cron.I want it to be instantaneous. I am working on a web server where the hosts turned-on safe mode and turned off a-lot of the functions for PHP (including exec) in order to secure their servers. Outside of that, I do have access to chroot and can pretty much do anything on the server. I want to use ImageMagick to create dynamic images based on form data.

I was trying to find a work-around with PHP where I can still use ImageMagick (a shell-based imagining program) by causing SQL to execute a shell script after the form data is saved to a table. Is there anyway it could cause a flag to automatically run a shell script when someone adds a new row to a certain table. It has to be instantaneous, more or less, so that the user isn't sitting there waiting for a minute for cron to catch any changes to the database.

View 1 Replies


Programming :: Shell Can't Execute Through Ssh But Local Well?

Jan 10, 2010

The two host one is Aix 5.3 and another is Suse 10sp2 the both have the same script which including the following parts:

if [ `date +%a` = "Mon" ];then
if [ "$RESULT" = "" ]; then
echo "The `hostname` $DATE ok"


View 1 Replies View Related

Programming :: Parallel Shell Scripts To Execute Using LAM?

May 29, 2011

i want to know whether we can write a shell script which can utilize 2 CPU's of a cluster...I heard its possible through C Shell [URL] But im familiar with bourne shell only....So is there a possibility to write Parallel Scripts.

View 5 Replies View Related

Programming :: Unable To Execute FOR Loop In Shell?

Apr 19, 2011

hint me why and how to execute the below for loop, the way i am trying to?

[bkcreddy17@local:~]$ cat -n test
1 date
2 ls -l


View 14 Replies View Related

Programming :: Unable To Execute A 4GE File In Ksh Shell ?

Apr 7, 2010

I am trying to execute a 4GE file using command something like this "/usr/bin/ksh path of the file with some arguments " ex: /usr/bin/ksh /home/abc.4ge S "./xyz" . I am able to execute the 4GE without this "/usr/bin/ksh" specifying in the command which basically runs in ksh shell itself. But when i try to run it exclusively using the path of the shell it gives me an error something like this "/usr/bin/ksh: /home/abc.4ge: cannot execute". I did check the permissions and all the file has execute permission.

View 7 Replies View Related

Programming :: Execute A Shell Script (with Source Command)?

Nov 19, 2010

This is weird. I have a shell script with no execute rights.$ chmod -x test.shThen I try$ test.shwhich does not work. (I have "." in PATH)When I do$ . test.shit works! I can run the script even though I have no execute rights. Why is that?Another question: If I have a shell script without a hash bang, I still can execute the shell script. Why? What does hash bang do? If there is no hash bang, why is the shell script run? What does the hash bang do

View 9 Replies View Related

Programming :: Shell Script To Execute Oracle Procedure

Jul 19, 2010

I am writing shell script for executing oracle procedure. Shell script need to take 3 parameters from one data file rest of the parameters need to pass in command line it self. Total 7 parameters are need to pass for shell script.1st,3rd,5th parameters need to take from dat file and rest of 4 parameters from command line.

Below is one oracle procedure:
EXEC CIM_MGMT_INSTALL.addFlow('$1','1.0','$1','Settings','$2','ECCD2',NULL,1);
$1is 1st and 3rd both places need to pass same parameter.$1,$2 need to take from data file as earlier says.

View 2 Replies View Related

Programming :: Sudo In Shell Script \ Ask For The Password Then Execute The Script At Background And Get Back To Menu?

May 27, 2011

Whats wrong with this line?Code:sudo -u user /usr/bin/nohup sh /home/user/ &This should ask for the password then execute the script at background and get back to menu

View 8 Replies View Related

Ubuntu :: Added New User But Can't See The Shell Prompt?

Apr 8, 2010

I just added a new user to my ubuntu by:

useradd -gdevelopers -d/home/peter -m peter

when peter logs in (after I created a passwd for him) he doesn't see the shell as I do:


ALSO, he can't user the TAB to move inside a folder (when you type cs /home/p and use tab to get /home/peter)

View 2 Replies View Related

General :: Execute This On The Shell?

Mar 12, 2011

ill have this question on the test maybe : In dir00 directory create files year01.txt, year02, ...year05.txt with January calendar for 2001-2005 years in it.-i'm lost. i execute this : cat | cal 01 2001 > year01.txt

View 12 Replies View Related

Ubuntu :: How To Execute A Shell File

Jan 11, 2011

Ubuntu version 10.10File location inside a folder on DesktopFile extn : .shI need to run this file in terminal console, but what path to be given is the question.

View 5 Replies View Related

Ubuntu :: How To Execute Shell Script Using GUI

May 19, 2011

Before I re-installed ubuntu I could just double click a shell script and I got prompted to chose if I wanted to edit it or run it. Now it just opens it in gedit.How do I execute it using the GUI not the command?

View 4 Replies View Related

General :: Execute A Shell Script On Startup?

Mar 31, 2010

I have create a script to start a server(my first question). Now I want it to run on the system boot and start the defined server. What should I do to get this done? My findings tell me put this file in /etc/init.d location and it will execute when the system will boot. But I am not able to understand how the first argument on the startup will be start? Is this predefined somewhere to use start as $1? If I want to have a case startall that will start all the servers in the script, then what are the options I can manage.

My Script is like this:

case "$1" in


View 2 Replies View Related

Networking :: Execute Shell Scripts On Events?

Feb 20, 2009

Users will write data on a samba shared folder at any give time. I need to execute a script as soon as some thing is written to that shared folder. What I need to know how to execute a script as soon as something some data is written to that shared folder.

View 1 Replies View Related

General :: Read A Line Of C Comamnd And Execute In Shell Script?

Nov 9, 2010

I am using following code to read a lien from a file and store the value to a variable $line and execute it.

while read line
./$line &


View 6 Replies View Related

Software :: Execute A Shell Script From A Simple Html Web Page?

Mar 11, 2010

I wish to execute a shell script once a button on my html page is clicked.

View 7 Replies View Related

Software :: Execute Shell Commands That Require Root Password From PHP?

Jun 26, 2010

php. I am developing a web-interface for an application that sometimes needs root privs. Editting /etc/sudoers is not an option since the web interface needs to be portable to other users when they install my application. Is there any workaround ?PHP Code:

php code:$command = "./ /dev/$DISKNAME &";$shellOutput = shell_exec($command); 


View 2 Replies View Related

Programming :: How To View New Added System Call

Aug 30, 2010

I successfully added a new system call in CentOS Kernel but I don't know where to view it! My kernel version is -

View 2 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

if [ $# -eq 0 ] ; then
for i in * ; do
if test -d $d/$i ; then
echo "$i:"

View 10 Replies View Related

Programming :: Socket And Timer Programming - Server Doesn't Execute Any Msg Which Client Sent

May 16, 2011

i have a server program which accept multiple client connection and am using polling. like every 2 secs it will look to client whether any data is received after it binded. i have used setitimer but there is runtime error i got.. the server accept all client connection but doesn't execute any msg which client sent.


View 1 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?



>>> import subprocess
>>> help(subprocess)
[pages of stuff to read]

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

General :: Write A Shell Script That Allows Only User 1 And User 2 To Execute A Program?

Feb 25, 2010

I've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?

View 1 Replies View Related

Programming :: Prevent "leak" Into Shell From A Customized Shell Menu Script?

Dec 15, 2009

I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.

View 11 Replies View Related

Programming :: Code That Will Never Execute

May 23, 2011

Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.

View 6 Replies View Related

Programming :: Execute The String That Sed Actually Outputs?

Aug 2, 2010

I've been able to get the right output that I need from sed, but how can I execute the string that sed actually outputs?

View 3 Replies View Related

Programming :: Can Php Script Execute X11 Applications

Jun 2, 2010

If I put


$r = exec('whoami');
echo $r;

into my php script, it works fine. However, if I put


$r = exec('myX11application');
echo $r;

it doesn't (to be precise, the script still works, but myX11application is not executed). Of course, scripts are run by user "apache", who doesn't have access to X11 server and doesn't even have DISPLAY variable defined.I installed virtual framebuffer Xvfb, created a small bash script:


Xvfb :2
export DISPLAY=:2

and called it with exec from php, but it still doesn't run since it looks like Xvfb can't start if the normal X server is running (I need that for development purposes). The reported error from Xvfb is


(EE) config/hal: NewInputDeviceRequest failed (2)

Is there a solution to have php running your X11 applications with normal X server running?

View 6 Replies View Related

Programming :: Cannot Execute Binary File

Feb 11, 2011

I'm trying to compile a simple script for a ar71xx (bleeding edge /from snapshots) Openwrt router.I have previously compiled scripts for Kamikaze 8.09. I just copied the gcc file inside the SDK dir and used it without problems.

View 4 Replies View Related

Programming :: Execute Code For N Time?

Apr 23, 2011

I'm doing a program and I want it to execute some code during n seconds. For example e put a command in the shell like this 'ls % 10' and the program should run the command ls for 10 seconds.I'm trying something like this:

pid = fork();
if(pid == 0) {


View 2 Replies View Related

Programming :: Execute Commands After Run Command?

Jan 13, 2011

I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??

View 2 Replies View Related

Programming :: Execute External Program Using C?

Mar 30, 2011

Assume two applications, Application A and Application B. Both are written in C language.I had tried to use system() function in Application A to execute Application B. It success, but Application A cannot continue its own tasks before Application B exit. I want Application A to execute Application B, but Application A can continue its tasks without waiting for Application B to exit.

View 3 Replies View Related

Copyrights 2005-15, All rights reserved