General :: Executing A Shell Command In Emacs?

Dec 17, 2010

I tried to execute a shell command by M-! cmd RET but it did not work.M-! does not turn up in the microbuffer no matter how many times I press Alt+!.But if I go to Tools menu and select Shell Command... option then it writes M-! to the microbuffer and everything works fine.What is the problem here?

View 2 Replies


ADVERTISEMENT

Programming :: Executing Shell Command In JSP

Aug 24, 2010

what we are trying to do is, to let the customer click a button in the web browser, and then the web server to call a shell script to do the work. The output from the stdout && stderr of the script should be displayed in the web browser once finished or timeout, along with the exit code of the script.

The shell script is however not on the web server, but on another app server. So to call this script from the web server as the identity 'tomcat':

Code:
$ sh appuser@app-server:$appbin/app-script

The .ssh/id_rsa.pub thing is done, and we have no problem doing this in the command line so far.

Our loaded ex-colleage has left us the webpages (jsp) with code like these:

Code:
<%@ include file="jsp_functions.jsp" %>
<%
String cmd = "sh $appbin/app-script";
ExecResult r = new ExecResult();

[Code].....

View 6 Replies View Related

Ubuntu :: Emacs -- Run Shell Command W/o Output?

Jul 12, 2011

I write LaTeX in Emacs and then run a shell script to process the LaTeX code. I used to run a subshell buffer with M-x shell and then execute the script from within there, but this results in a lot of switching between buffers, which seems unnecessary. Then, I found out about executing shell commands with M-! cmd RET, as described here:[URL]The problem with this is that the output from the script splits my screen. It's a nuisance, and I would like to run the script without any output. I've tried appending > /dev/null to the command, but it doesn't work.For example, when from within Emacs I enter M-! followed by

Code:
sh make.sh > /dev/null
it splits my screen so that one portion displays output from the make.sh script. I want it to run silently, and leave my Emacs buffers alone

View 3 Replies View Related

General :: Errors Executing Shell Script: "command Not Found" And "no Such File Or Directory"

Jan 14, 2011

A colleague gave me a shell script ("dti_motion") which needs to be run from the directory containing all the files it works on. I want to run the same script for several different directories. But I don't want to have to cd into each directory, run the script, wait for it to finish, and then cd to the next directory (there are 52 to do altogether).

So I wanted to write a very simple script that will cd to each directory and perform the script there, before going on to the next one. My colleague's script ("dti_motion") is stored in my home/bin/ and is executable. My home/bin/ is in my path, as verified by echo $path. When run from a directory containing the necessary information, the dti_motion script works perfectly well. I wrote an extremely inelegant script called "dti_motion_do_all" which is also stored in my home/bin/ and executable:

#!/bin/sh
#Get motion information for each subject, using Mark's script, called dti_motion
cd /imaging/cr01/PD_DTI/C_10/12x5

[code]....

I know there will be more elegant ways to write this script with loops, rather than simply using cd, but for the moment, I just want this to run, until I have learnt to use loops properly. how to correct either of those "command not found" or "no such file or directory" errors, given that both the original dti_motion and my dti_motion_do_all script are in my /home/bin/ (which is on my path) and both scripts are executable?

View 1 Replies View Related

General :: Shell Script Executing Automatically?

May 16, 2011

I want login.sh shell script executing automaticaly whenever i open the console..?and also logout.sh shell script executing automaticaly whenever close the console.

View 1 Replies View Related

General :: Executing .sql Files In Shell Script?

Nov 22, 2010

i have n files and each file has 5-6 .sql files.Now I need to wrie a shell script that executes all the n files in parellel and for each n file the .sql files sequentially.eg

CRM_File CM_file AP_file
crm_file_1425.sql
cm_file_5789.sql
ap_file_4124.sql

[code]....

run CRM_File CM_file AP_file in parellel and each file under CRM_File,CM_file,AP_file sequentially.

View 6 Replies View Related

General :: Executing Shell Script With 654 Permissions Inside Another One

Apr 22, 2010

I have this scenario, where in I'm calling a shell script inside another shell script. The only criteria here is that the embedded script will have 654 permissions and the master script should be able to execute this embedded script. The sample code is given below:

#!/usr/bin/ksh
maindir=/usr/home01/temp/dir
bindir=${maindir}/batch/bin
${bindir}/test.ksh -d ${dblogin} -i ${datadir} -r ${filedt} > ${tmp_log}

The test.ksh which has 654 permissions is called by the main.ksh script and when I try to run it using ./main.ksh, it fails with the error "Execute permissions denied."

View 2 Replies View Related

General :: Executing Shell Script - Setting Permissions And Providing Path

Jan 4, 2011

I've been looking around the net for executing a shell script. My basic understanding is that after setting executable permissions and providing a path (#!/bin/sh) in the first line of the script, I can type ./myscript to execute instead of sh myscript. This is not working for me. I can run "sh myscript" but not "./myscript" even though I know for sure I have across the board execute permission and my sh path is correct. I'm working on a redhat linux station.

View 6 Replies View Related

General :: Executing Command Over A Network?

Aug 6, 2010

I have a some c source code files that i have to copy to linux machine from a windows machine over a network. This source code folder has to be copied into a particular directory structure in the linux system at the other end. After copying the file into the appropriate folder in the linux server i have to instruct the linux machine to make(using the make file that is there with the c files) this source code from the windows machine. Does anyone have any idea in regard to how this can be implemented?? i am trying to have a gui client that has the above mentioned options(copying and inserting the c files into the appropriate directory and then for making the files and getting the executable.)

View 3 Replies View Related

General :: Bash: Emacs: Command Not Found?

Oct 18, 2010

i am using scientific linux, fedora 12accidentaly i changed LD_LIBRARY_PATH of the root profile to a different location. so terminal cannot understand any command as i type. is there any other ways to access .bashrc file exept using editors emacs, vi, nedit. my own profile works fine but i dont have permission to access the root folder. only commands the terminal responds to are pwd, cd, echo. i dont have any clue how to restore the library because it locates here:

[root@localhost ~]# echo $PATH
/usr/local/src/root/bin:
[root@localhost ~]# nedit .bashrc

[code]....

View 4 Replies View Related

General :: Executing A Program From Command Prompt?

May 27, 2011

I'm trying to run an application from the command prompt. I've set the path in .bashrc. My executable file and all other files needed by it are saved in the same directory as the path. When I enter the executable name to run it, I get an error message saying that the command is not found.

View 14 Replies View Related

General :: Ssh'ing To A Host And Executing A Command Not Working Correctly?

Aug 20, 2010

I have the following command:ssh $USER@$HOST "ls /ops/pkg/ec/`grep "PKRTS" /ops/pkg/ec | awk '{print $1}'`* > /tmp/tmp_file"What the above SHOULD do..is, ssh to the host then execute the command.The command should first execute the grep and awk between the back ticks, and generate a file name, then ls using that filename* and write that data to a temp file.However, it executes the grep and awk before even SSH'ing and the command that goes to the server is simply an "ls /ops/pkg/ec/* > /tmp/tmp_file" since the grep and awk return nothing on the local machine.

View 1 Replies View Related

General :: Executing An Awk Command Inside Perl Script?

Jul 30, 2011

I want to execute a awk command, which reads from txt files and sums the numbers from the first column for those listed only inside a <init> block -- The awk command is like

Code:

awk '/</?init>/{x = !x}x{a++}x && a > 2{sum+=$1}END{printf"%E" "
", sum}

So, I want to execute it inside a perl script, and execute the awk command for the infile which is also defined outside awk loop, ie doing something like

Code:

foreach $infile (@ARGV) {
$gzin = gzopen($infile, "r") || die ("Couldn't open file $infile
");
# No. events and cross-section from current file

[code]....

View 1 Replies View Related

General :: Executing Scp Command: Missing Dependency Libcrypto.a

Jun 14, 2011

When i try to execute scp command:

scp -r /localhostdirectory username@remotehostservername:/remotehostdirectory

I get the following error

0509-036 Cannot load program /usr//bin/ssh because of the following errors:
0509-150 Dependent module /homepath/server/bin/libcrypto.a(libcrypto.so.0.9.8) could not be loaded.
0509-153 File /homepath/server/bin/libcrypto.a is not an archive or
the file could not be read properly.
0509-026 System error: Cannot run a file that does not have a valid format.

View 6 Replies View Related

Ubuntu :: Emacs Initialization/shell Script?

Jun 21, 2011

I have emacs23 from the Lucid repository.I know how to load and edit remote python files with

Code:
C-x C-f /ssh:usr@domain:/directory/*.py
Since I use this same command every time I open emacs, and I see that you can use lisp

[code]....

View 2 Replies View Related

OpenSUSE :: Using Emacs Shell-bash-mode-hook?

Feb 26, 2010

I want to show line numbers automatically in bash scripts (a habit of being a programmer) and when I load an emacs lisp file it works from the command below but the following command that sets up the same thing for bash scripts doesn't work. I played around with this for quite some time and couldn't find anything that would make work.This is the first time I have tried to customize emacs so it could easily be something ignorant on my part.

;; Load additional packages
(load-file "~/.elisp/whitespace.el")
(load-file "~/.elisp/setnu+.el")

[code]....

View 1 Replies View Related

General :: Embedded Reboot Crash - Error Executing The Reboot Command

May 4, 2011

I'm working with Linux 2.6.23 on an embedded device and am receiving the following error executing the reboot command.

View 2 Replies View Related

OpenSUSE Install :: Executing Command At Boot?

Apr 7, 2010

im searching for this answer now a pretty long time and i know that many similar questions where asked and i all looked themIm trying to run a the command "vncserver" on our opensuse11.2 server when its booted.many posts here endet in "put a sh script into your /kde4/Autostart" but that didtn help for me because the server runs without a screen and normally nobody is logged in. When i logged in that worked fine.i also tried to add the command "vncserver" to "/etc/init.d/boot.local " but that didnt work too. i think its to early executed to work.i also tried to activate the service to start up at boot with chkconfig vncserver start but the service vncserver is "unknown". when i type vncserver into the console after logging in everything is alright.you see i really tried a lot and searched a long time at google and in this forum but nothing worked

View 4 Replies View Related

Red Hat / Fedora :: DNS - Command Not Executing (Connection Refused)

Mar 31, 2010

I want to fix my dns if I issue command service named restart it just wont execute the command all it say is connection refused error from rc.d just cannot figure out what the problem is my server is ruining on red hat Linux 9 which is also my proxy server.

View 6 Replies View Related

Software :: Executing The Command On The Remote Machine

Oct 5, 2010

If I type this manually on the command line, it works

Quote:

ssh -Y user@machine 'firefox &'

I ssh into the remote machine as the named user and pop an instance of firefox from that machine back to my own. If I put the same thing into a shell script though, it fails.

Quote:

#!/bin/bash
ssh -Y user@machine 'firefox &'

I'm just left sitting at a command line on the remote machine. Why does the script fail and how can I make it work?

View 4 Replies View Related

Programming :: Executing An External Command With Python (CGI)

Jul 8, 2011

I need to execute an external command with Python from Web. I know there is subprocess module that executes external programs but I'm trying to execute a command registered for the execution of a program. In this case when I execute my file in the shell everything is Ok, but from the Web it doesn't work.

View 1 Replies View Related

General :: Run A Shell Command With &?

Jun 15, 2010

I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the purpose of them? Are they always used together with nohup?

nohup foo.sh <script parameters> >& <log_file_name> &

View 6 Replies View Related

Ubuntu :: Customize AUCTeX View Command In Emacs?

May 20, 2010

I've been using Emacs with the AUCTeX package to edit and compile my .tex documents lately, but there's something that's been bugging me. First, here is the short question:How can I costumize the default view command emacs runs when I type C^c C^c <enter>?I've read that it's done with the tex-view-dvi-command variable, but I've had no luck getting it to work at all.Now the explanation:It bugs me that whenever I type C^c C^c to compile, and then C^c C^c to view dvi, emacs doesn't automatically give focus to the dvi viewer (xdvi). Digging a little, I found out that the command "wmctrl -a main" gives focus to xdvi ("main" is the title of the xdvi window). So, if I can only customize AUCTeX's standard view command to include "&& wmctrl -a main" at the end, than my problem would be solved

View 2 Replies View Related

Ubuntu :: Error When Executing 'gnome-terminal' Command

Feb 11, 2010

I wrote a shell script and tried to execute it in separate terminal using command 'gnome-terminal -e <script>'. When executing first time, it went fine.From second time, I am getting error 'There is error creating child process for this terminal' repeatedly.

View 5 Replies View Related

Ubuntu Servers :: Executing PHP File Via Command Line

Nov 16, 2010

I have a php file that I need to execute via a cronjob. This file should be run by the www-data user as its a file in my /var/www/project folder. When I run this file under root (php -f cron.php) everything works perfectly, but I want it to run under the www-data to be safe. Before I run it vai crontab I tried it via command line as the www-data user and I receive errors:

Fatal Error: Allowed memory size of 8388608 bytes expired (tried to allocate 232 bytes).

But when I run it as the root user I get no errors and everything works correctly. The file cron.php is used to process automated tasks in my CRM. So I don't really want to have the root user running a crontab every few minutes for this.

Must the www-data user be given more permissions? I am using Ubuntu 6.06LTS
PHP - 5.1.2
Apache - 2.0.55
MySQL - 5.0.22

View 4 Replies View Related

Ubuntu :: Cron Daemon Is Running But The Command Isn't Executing?

Mar 28, 2011

I was just curious if cron had to be enabled before use. i have a crontab, and the cron daemon is running, but the command isn't executing...

View 9 Replies View Related

General :: Looking For System Shell Command?

May 31, 2011

I'm looking for a specific command,if it exist... i want to login from my server to another Linux server,but the question is: can i do it in a one line command for ex:
usually you type: ssh "user"@10.1.1.1 and then the password,but I'm looking for a command in one line a fake ex: ssh user@10.1.1.1 -p "password" something like that.
I don't know if anyone of you understand what do i want to say .

View 6 Replies View Related

Fedora Networking :: Error In Executing The Command Ndiswrapper -i Bcmw15.inf

Nov 13, 2009

I use a Dell inspiron 1525, with windows 7 and fedora 8 in dual boot. Ihave broadcom 4310 wireless card to use.. how ever i could not activate my wireless.. so i guess this the right place where i can get a solution to the problem. After installing the ndsiwrapper by yum, i tried to execute the command ndiswrapper -i bcmw15.inf This returns with an error couldn't open bcmw15.inf: No such file or directory at /usr/sbin/ndiswrapper line 219.

View 1 Replies View Related

Red Hat / Fedora :: Executing A File - Showing Error - Command Not Found

Aug 23, 2010

I m using Redhat Linux 5......I am trying to install Nero 4 DVD Writer s/w...It is an exe file ...

I have given permission like this:

Then i execute the file like this:

Its showing error like this:

View 9 Replies View Related

Ubuntu :: Code In Emacs File To Start Emacs Maximized?

May 17, 2010

I was using the following code in my .emacs file to start emacs maximized:

Quote:
(defun toggle-fullscreen ()
(interactive)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32

[Code]...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved