Programming :: Multiple Command In Ssh Not Working?

Apr 22, 2011

I have prepared a script which will login to each server and search for a keyword.
I want output on same machine from where m running script.

When i try to run command on any machine.. It works well.

w=$(grep -irH "keyword.com" /home/*/public_html/*);if [ $? -eq 0 ];then echo -e "
$HOSTNAME";echo $(grep -irH "keyword.com" /home/*/public_html/* | cut -d: -f1 | uniq | awk '{for (i=1;i<=NF;i++) printf "%s
",$i}');fi

[Code]....

View 9 Replies


ADVERTISEMENT

Programming :: Ssh Command On Multiple Hosts?

Apr 13, 2010

I want to create a script to insert the fstab and hostname in a textfile of multiple servers on the network without a password. The servers are situated in a text file. So i want to read the text file line by line and write the output into another textfile.

View 10 Replies View Related

Programming :: Expect Command And Multiple Arguements?

Oct 4, 2010

I have the following code which I've thieved from here, there and everywhere:

Code:
[root@localhost /]# cat autossh
#!/usr/bin/expect -f

[code]....

View 3 Replies View Related

Programming :: Multiple Input Into Seq Command From Pipe - Single Column Unique Numbers

May 13, 2011

Have this script which is reading in a series of files, one at a time with while-do-done loop, each file goes through various greps/awk's where this info is then saved to various files for later use. i.e....

Script is being run on Linux Red Hat,

In one of the grep/awk's the output (currently) are 2 columns (min max), i.e....| awk '{print $1, $2}' | sort -u which outputs (e.g.)

The number of "min max" pairs varies from file to file. Want to output a single column of unique numbers from the min max pairs & get the number of them for input to a file...i.e...

Where <PROCESS> is some process/technique that will generate a single column of integers (increment of 1) to pipe into the next one (sort -u)

i.e. (example from above)

Have tried command seq - only works for single pair input i.e.

Is there any command like seq etc which will output a single column based on a input of min max numbers (increment 1) to pipe onwards to next command?

View 4 Replies View Related

Programming :: GDB (Control C) Command Not Working

May 12, 2011

I've just started using gdb at my new job, and I'm having a small issue debugging C++ with it. After I execute "continue" or "run" through gdb, I'm not able to return control to gdb. Based on the documentation I read, I should be able to use Control-C to interrupt the program, and have control return to gdb.

This does not work on my setup. Not sure if it's related, but I'm debugging on a remote machine. I tried through PuTTY and xterm using Exceed XServer. In both cases, gdb does not respond to Control-C. This is quite annoying because I have to restart my program every time I want to set a breakpoint.

View 2 Replies View Related

Programming :: Ping Command Not Working In Tcl/tk?

Feb 16, 2010

I can't get exec ping to work on my system. wish is located in /usr/bin/wish8.4

Code:
#!/usr/bin/wish8.4
text .txt
set in [open "/root/hosts.txt" r]
while {[gets $in line] != -1} {

[Code]....

View 2 Replies View Related

Programming :: Source Or Dot Command Not Working In Makefile

Apr 5, 2010

I am trying to run a script to setup environment variables and then run other commands in a make file. But the source or the dot operator (shell is bash) does not seem to take any effect as the subsequent command didn't pick the environment up. Do I have to put every lines of the environment setup in the first script into the makefile instead?

sample setenv.sh
#!/bin/sh
export MYDIR=/somedir

sample makefile:
all: source ./setenv.sh
echo $(MYDIR)

View 5 Replies View Related

Programming :: Ptrace System Command Not Working Properly In X86 Platform

Apr 20, 2011

basically in the child process iam just calling the ptrace(PTRACE_TRACEME, 0, NULL, NULL) system call but if add this stsyem call rest of the code not working properly. i found the reason basically what happening is when we have ptrace() system call its printing the same variable 3 times i.e its not executing it 3 times but just it is printing 3 times .iam just wondering how it could be possible.

View 1 Replies View Related

Programming :: Programming To Multiple Video Cards

Jun 24, 2009

I've browsed the internet, but haven't found a satisfying answer. Hope this forum can help me in the right direction.I'm exploring the possibilities of creating a program that manipulates (writes to) two different video cards.I program in C and hope to avoid high level libraries like Xlib to keep the mem footprint as low and the performance as high as possible. Windowing is not important no desktop environment will be used. Be able to write two pixels (one to each screen) to would do.

How would I go about?To give an idea of the solution I'm looking for:One screen will show thumbnails of images on the hard drive. Clicking an thumbnail on display A will show the selection full screen on display B. On a laptop; preferably thumbnails on the laptop screen and the selected image on the external monitor.Is this possible with just low-level libs or do I need X or some third-party software to make life easy?

View 14 Replies View Related

Programming :: Effect Of Using Eval To Execute A Command As Opposed To Writing It On The Command-line?

Jun 18, 2010

Code: cmd='date | wc'

$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?

View 4 Replies View Related

Programming :: Command Line Invocation Of Gnome-terminal To Run More Than One Command?

Feb 16, 2010

I am trying to learn how to pass more than a one-command startup for gnome-terminal.

I will give an example of what I'm trying to do here:

Code:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
${0##*/} [-x] [-g]
code....

However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.

This same error occurs if the gnome-terminal line is changed to

Code:
gnome-terminal -e mcTerm

Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.

View 4 Replies View Related

Programming :: System Command / 'mcc' Is Not A Recognised As An Internal Or External Command?

Apr 13, 2010

I am writing a perl script which uses the matlab compiler to compile a .m file.

I am using the system("mcc �m file.m"). I have matlab installed and both script and exe are in the same drive.But i get the following error .

'mcc' is not a recognised as an internal or external command ,operable in program or batch file.

View 5 Replies View Related

Programming :: Show The Output Of Shell Command Into A Textbox, Ex Ps -efc Command?

Oct 20, 2010

I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?

View 3 Replies View Related

General :: Using Multiple Epstopdf Command?

Jan 6, 2011

I've installed epstopdf and can get it to work for one file at a time. But I have about 100 *.eps files which I want to convert to *.pdf using this command. How could I get linux to find all *.eps files in the directory and repeat the command for each converting them to *.pdf?At the moment the command that works for me is, $ epstopdf file.epsAnd works for one file

View 5 Replies View Related

Ubuntu Networking :: Wireless Suddenly Stopped Working AND Rfkill Command Not Working

Jul 13, 2011

When originally installing 11.04 I had problems getting my Ralink 5390 wireless card to work.

Today my computer froze completely and I had to turn it off via the power switch. When I turned it back on, wireless was no longer recognized! My iPod can connect to the network just fine, so it must be an Ubuntu problem. There are no problems with my ethernet connection either.

I researched this and found several threads about blocking and unblocking wireless devices using the rfkill command. Well, unfortunately for me the rfkill command doesn't work. When I type sudo rfkill list or sudo rfkill unblock all, nothing happens; it just returns me to my bash prompt. I even tried uninstalling and reinstalling rfkill...nothing.

View 1 Replies View Related

Programming :: Convert This Awk Command From Command Line Into An Awk Script ?

Oct 15, 2010

I'm trying to convert this awk command from command line into an awk script, but just cannot get it to work:

This is what i have after my BEGIN

Am i missing something here? this just prints out the count for everyline, not counting lines on 5th field that match 'A'

View 1 Replies View Related

Programming :: Calling Command From History Using Variable Like !$command?

Nov 19, 2008

suppose i store the history number of a command say :

1004 cat file

Then now i want to run it like : !1004 but by using a variable.

command=1004
!$command

i am getting errors like :

command=1004command

View 2 Replies View Related

General :: Run Same Command On Multiple Files With Same Extension?

Nov 10, 2010

how to run a command on all files with the same extension in a directory like this:

Code:

tex breqn.dtx; tex empheq.dtx; tex flexisym.dtx; tex mathstyle.dtx; tex mathtools.dtx; tex mhsetup.dtx; tex xfrac.dtx;

but in a simpler manner? I found this: Code: find . -type f -name *.dtx -exec tex {} ; but isn't there something simpler?

View 4 Replies View Related

General :: Viewing Multiple Files With The Less Command?

Apr 14, 2010

When we view multiple files using less, how to go on to the next file? I gave these two commands:

Code:

[root@localhost log]# ls -lt boot.log*
-rw------- 1 root root 0 Apr 11 04:02 boot.log
-rw------- 1 root root 0 Apr 4 04:02 boot.log.1
-rw------- 1 root root 0 Apr 1 19:14 boot.log.2
-rw------- 1 root root 0 Mar 21 04:02 boot.log.3
-rw------- 1 root root 0 Mar 14 04:02 boot.log.4
[root@localhost log]# less boot.log*

This is what I got:

Code:

boot.log (file 1 of 5) (END) - Next: boot.log.1 <RETURN>
(END) - Next: boot.log.1

I could not view boot.log.2.

View 3 Replies View Related

General :: Multiple Lines At The Command Line?

Feb 22, 2011

I've seen a few tutorials that have commands and parameters on multiple line, like the one below:

Code:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

I can copy and paste this in Putty, but what if I want to manually type it? If I press return, the first line gets processed, so how do I insert a new line?

View 4 Replies View Related

Server :: Sendmail To Multiple Recipient In Command ?

Jul 17, 2011

Through shell script iam sending mail, i want to send mail to multiple recipient,can any one help me how to send mail to multiple recipient.Iam sending mail through the below given in shell script to one recipient.

View 2 Replies View Related

Server :: Multiple Command In Ssh Giving Error?

Apr 23, 2011

I have prepared a script which will login to each server and search for a keyword.I want output on same machine from where m running script.When i try to run command on any machine.. It works well.

w=$(grep -irH "keyword.com" /home/*/public_html/*);if [ $? -eq 0 ];then echo -e "
$HOSTNAME";echo $(grep -irH "keyword.com" /home/*/public_html/* | cut -d: -f1 | uniq | awk '{for (i=1;i<=NF;i++) printf "%s

[code]....

View 3 Replies View Related

Software :: Command Line Cd Command Not Working Right

May 4, 2010

Using netbook asus 1005ha with lucid beta 1 with most of updates on learning to use the CLI and headaches cd command does not seem to reconise directories here is a sample

Code:

yeh i know read the f#####g manual i am but any help would be greatly accepted tried sudo with same commands same problem did have a problem on my debian system that was to do with paths this is not the same on a different footnote anyone thinking of upgrading to lucid sit tight on 9.10 there are still to many issues that need ironing out for a system that is your main system.

View 6 Replies View Related

Debian :: Multiple Commands Displayed On A Command Line?

May 21, 2011

I am trying to get 2 things to operate on the same line, for example echo Current Version: [cat /file/ver.txt] is there a way to do this?

View 1 Replies View Related

Ubuntu :: Find Multiple Files In The Command Line?

Mar 2, 2010

command line, I have a server for work that I ssh into and I need to be able to find multiple files (they have the leading text just the date identifier changes) and then zip the files (with bzip) them and then finally scp(Secure copy) them to another server.

These files are always in the same directory and this is a daily task and just want to make into a script that I run once I am logged into the remote server.

View 4 Replies View Related

Ubuntu :: Use Multiple Cut Command To Print Output On A Line?

Apr 27, 2010

how to use multiple linux cut comman to display on same line ?

e.g ls -il | cut -f6 d:
ls - il cut -f9 -d:

The linux script output is

filename
123

How to use cut to display on same line ?

View 1 Replies View Related

Ubuntu :: Move Multiple Files Via Command Line?

Sep 15, 2010

I liked the idea of the "cosmos" screensaver/desktop, but wanted to add my own pictures to the application. I navigated to /usr/share/backgrounds/cosmos and tried to drag and drop. I quickly found that I did not have permission to do this.

I googled my problem and found some command line tutorials telling me to sudo cp. My problem is that I have about 30 pics that I want to move in there, and I don't think I can just move the directory, they have to be in that folder as the pictures themselves.

I don't really feel like typing the cp line multiple times with multiple randomly named image files.

Is there a way to have the command line cp all of my files from one directory to another?

View 4 Replies View Related

Ubuntu :: Command To Split A File Into Multiple Files?

Nov 22, 2010

I have a log file on ubuntu 10.04 that has 500 lines of log data in it. What command could I use in a terminal to split the single 500-line file into generate ten files each with 50-lines of log files each?

View 2 Replies View Related

General :: Command-line On Multiple Monitors, ScreenWM?

Mar 26, 2010

I have an older computer with Arch installed that I want to use to accomplish most of my daily tasks using the command-line (Mailgrab, IRSSI, mpg123, Elinks, Vi, etc). I realize that there are many lightweight WMs out there that support multiple monitors, but it'd be nice if I could just use Screen or something to that effect to distribute my windows across two or three displays.

View 1 Replies View Related

General :: Wrapper For Unix Command With Multiple Parameters

Jan 7, 2011

I hope to add a wrapper script for the command with different parameters. For example, for any Unix command or script, like below:
command.sh -s p1 -o p2 -q p3
or
command.sh

Probably we could do as this way
cat wrapper
$1 $2 $3 $4 $5 $6 $7 | tee test.log
(assume it has 0 to 6 parameters)

and use it like
wrapper command.sh -s p1 -o p2 -q p3
wrapper command.sh

It is a little ugly to list all fixed parameter as above, do we have better code to handle various parameters?

View 4 Replies View Related







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