Programming :: PHP - Ping Test In Shell / CMD Window

Mar 4, 2010

I'm trying to do the following. from a php webpage click on a link, that opens a shell/cmd and runs an open ping to the device. so it must actually open a shell (for linux) or cmd (for windows) and run a ping to the specified ip. Currently i'm running an exec command, but for this i need to wait for the result to be fetched and print it out. I want to monitor it in realtime, by just clickingon the button. How to get this working?

View 1 Replies


ADVERTISEMENT

Programming :: Ping With Shell Script?

Sep 15, 2010

Now I am using ping command following

ping -I eth1 192.168.1.17

I want to add to shell script but I want type myself -I and eth1 when running the bash file.

View 9 Replies View Related

Programming :: Bash Shell Read User Argument From Command Line And Test It

Aug 29, 2010

Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.

The script is the following but i get an error saying "[: 6: =: argument expected"

View 12 Replies View Related

Programming :: Possible To Check Which Window Has Focus Using Shell Script

Nov 7, 2009

I'm playing a game through wine (fullscreen), when I alt-tab back to my ubuntu desktop, the resolution doesn't change back, but stays at the game resolution.I'm currently using a shellscript that changes the resolution back to my origional resolution (using xrandr -s 0)

Is it possible to check which window has focus using a shellscript.If the game doesn't have focus change resolution to my origional resolution.

View 3 Replies View Related

Ubuntu Networking :: Network Tools Ping Test Broken

May 20, 2011

Been helping a user who recently upgraded to 11.04 as his networking stopped after the upgrade. One thing I noticed was that he could not get ping to work.Then checked my 11.04 machine and it also fails to ping using Network Tools. I know the network is OK as I am using my Ubuntu machine to write this. Ping from the command line is fine so it is only the Network Tools ping test that appears to be broken.

Asked another Ubuntu 11 user to check his machine and he also cannot get ping to work even though his machine appears to be fine. Again this is only using the GUI tool.I know it is not hardware as I can dual boot and in XP everything is fine and I can ping all my systems. Also I am sharing a folder from my Ubuntu and my Mac shares the folder just fine. The Mac can also ping everything except the Ubuntu box. Command line ping works so it is not a basic network problem.So as far as I can tell the Network Tools ping test is not working. Has anyone else seen this or can confirm that it is broke. How do I report this or get it fixed?

View 3 Replies View Related

General :: The 'DOT' In A Shell Script Test?

Feb 21, 2010

I was looking at this line in an init file:

Code:
test -f /etc/default/postfix && . /etc/default/postfix
Which I understand to mean test that files /etc/default/postfix AND etc/default/postfix exist. Two things

[code]....

View 2 Replies View Related

Ubuntu :: Test Command In Shell Script?

Aug 29, 2010

I was trying to write a script, but for some reason I can't test two variables using -gt:

a=`expr $currentSize + 0`
b=`expr $fileSize + 0`
[$a -gt $b]
this is what I get:
[22234534: not found

what is the problem? It seems like I can't check if a variable is greater than another but only if a variable is greater than a fixed number. Is that so? By the way the variables $fileSize and $currentSize exist and $a and $b have a value.

View 9 Replies View Related

Ubuntu :: Test Gnome 3.0 Shell On Virtual Box?

Oct 22, 2010

I have ubuntu 10.10 desktop .. and i wanna try The new Gnome shell?

View 4 Replies View Related

Ubuntu :: Still No Way To Test Gnome-shell In Virtualbox / Get That?

Jan 16, 2011

I've searched and read lots about trying to get gnome-shell to run in Virtualbox(v4) with no success on my end. Lots of the posts are outdated and are using Virtualbox 3.

So anyone have any tips or hints for testing the Gnome-shell? (I'd prefer to test in with 10.10 in Virtualbox 4, but am open to upgrading to 11.04 if necessary)

View 9 Replies View Related

General :: Shell Scripts Variables Test?

Aug 5, 2010

What will be the output of the following Shell Script?

Code:
a="1245"
[-n $a]

[code]...

View 5 Replies View Related

Networking :: Cannot Ping With Command - Ping IP - Address But Can Ping With - Ping IP -I Eth0

Jul 15, 2011

I am using an virtual machine. where I need to ping from one machine to another. earlier I was able to ping. But after going to google.com once, I cannot ping back to this machine.

But if I gave ping -I eth1 <IP> then I can ping.

I cannot install any package, so tell me solution which includes not installing any package.

View 2 Replies View Related

General :: Referance To The Bash Shell / Use The Test Command To Evaluate?

Nov 8, 2010

Cis 140 student.how to use the test command to evaluate whether the shell variable I create contains a referance to the bash shell? and use the echo command to determine the result.

View 1 Replies View Related

Ubuntu :: Korn Shell: Syntax Error On Test A Function With Parameters?

Jan 4, 2011

Some may recall I recently gave up on bash, rather than give up my programming style.Surely I will have reason to return but that's another story. My little issue now:I am debugging a new [Korn] shell script. I have a function that performs a specialized match on a string and I see that I am able to call that function with no problem, with both of it parameters. The function does not do any print or echo command - it uses "return" for a TRUE (0) of FALSE (1), as is the shell exit code convention. Thus, I have the following test:

Code:
if [[ match_except_release ${PATH_DIR[$LC]} bin ]]
then

[code]....

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.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 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?

Example:

Code:

>>> 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

Fedora :: Gnome Shell Many Window Tiling

Jun 21, 2011

I'm looking for a feature in Gnome Shell that would allow me to tile all of the open windows on a desktop. Something akin to Fluxbox's ArrangeWindows keyboard shortcut. I know you can tile two windows side by side, but I would need something capable of tiling ALL of them. Does something like this exist, or would I need to look into writing a Gnome Shell extension?

View 4 Replies View Related

Ubuntu :: Shell Window To Be Split Vertically?

Nov 18, 2010

Is there a shell window where it can be split vertically and have 2 consoles going in one window side-by-side? I didn't see where I could configure the GNOME Terminal for it.

View 8 Replies View Related

General :: Kill All Processes Except Shell Window?

Aug 3, 2010

i was referring to an article given in following website.[URL] I was surprise to know that i can kill all running processes by using kill 0. However when i tried running the command nothing happened.

my machine details:

Code:

# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)
Release: 5.2
Codename: Carthage

View 4 Replies View Related

Programming :: Test If File Is In Use?

May 4, 2010

I want to copy files from an incoming directory, but don't want to copy a file if it hasn't finished being written. I thought of using fuser, but it doesn't seem to be very reliable. I vi'd a file in one window and then ran fuser against the file name and got nothing back. I'm just writing a simple bourne script on RHEL.

View 5 Replies View Related

General :: Launching Application Which Need Another Window Fails From Shell?

Feb 12, 2011

When I try to launch application which runs in another window (not inside shell), it always fails with this kind of message: (example from gnome-terminal)

Code:

** (gnome-terminal:2477): WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported Failed to get the session bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Falling back to non-factory mode. Failed to summon the GConf demon; exiting. Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See [URL] for information. (Details - 1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.) I am running it as root, have GNOME installed and running, and also fresh install of gconf.

View 8 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 :: Test Program To Get The CPU Utilisation

Mar 9, 2010

I wrote a test program to get the CPU utilisation. I hope to extend it to take cpu utilisation on multi core machines. Hear I used the equation for taking cpu utilisation given at [url] of JmSchanck post. But when I match the output of my program against 'top' and 'system monitor' output it seems quite high. Sometimes cpu utilisation goes more than 100%.

So the given equation in that url is correct? can anyone give me the equation to take CPU utilisation?

Code:

View 3 Replies View Related

Programming :: How To Get Grep Output 0 - 1 And Test It

Apr 7, 2009

I am trying to use a shell script to find a string in a file and do something when found. code...

What should happen is pppd will start in a different process and stream it's output to pppdout. pppdout should be created in the current folder. Then the script should periodically check the pppdout file for the string Script (which eventually will appear, some seconds later) and when found exit the script. Ultimately the script will do something useful when the text is found. However, the output from the program is a repeating: 'scriptname.sh: 12: FOUND: not found'

Where scriptname.sh would be the name of your script and 12 refers to the line with 'done'.

Why does grep not find the text, or at least why deos my script not check the grep output correctly?

View 10 Replies View Related

Programming :: How To Test Kate Plugins

Mar 20, 2011

I wanted to make some modifications to a Kate plugin, so I cloned the git repository, started doing a few changes, and it compiled. The problem is that when I run it, it uses the version of the plugin installed in the system, not the one compiled with Kate.

View 1 Replies View Related

Programming :: How To Test Whether A Macro Is Defined

Mar 20, 2011

I've been reviewing some source code recently which contains many conditional compilation statements, and I found it hard to understand the code not knowing whether some macro is defined or not. Is there any way to test whether a macro is defined?

View 2 Replies View Related

Debian Multimedia :: Gnome - Window Borders And Shell Theme Look Like As Before

Apr 1, 2011

I've recently upgraded to gnome shell in experimental, and I like it so far. However, the window borders and themes look like how Gnome 2 did before you install gtk2-engines and some themes. Are there any themes in the repositories that I'm missing, or are they just not there yet?

View 2 Replies View Related

General :: Create A Menu Box Window Using Dialog In Shell Scripting

Feb 3, 2010

I am using Linux on my system. I don't have gui for my system, only console is there.

I have some task to create a menu box window using dialog in shell scripting.

I have to take input from user & save it in a file.

But this should like html form as e.g.

Name - .....................
email id - ..................
phone - ......................
location - ...................

Submit Cancel

Such window should be displayed on console using dialog & then user will enter his information there as Name,email id, phone,etc & submit it, then it gets saved to a file. Here submit & cancle are buttons. I have to do it in bash shell scripting. Or give me some examples like the above with shell script code.

View 1 Replies View Related

Programming :: Passing Input To Program For Test

Apr 13, 2011

I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file. I have got an input from my lecture and she said after compiling in Linux I must write:

1-to compile:
Code:
g++ (files with cpp)
2-to see the output:
Code:
./a.out
3-to test with input:
Code:
./a.out < input.txt >

My problem is in step three. What I must write in the command part after" step2" to see the output?

View 3 Replies View Related

Programming :: How To Test Disown And Nohup Commands

Mar 20, 2010

I ran a perl script in background with nohup and disown to make sure my script runs even after the parent process is terminated.

Method 1: nohup
> nohup perl run.pl &
[1] 2080

Method 2: disown
> perl run.pl &
[2] 2448
> disown

In either method, the script process doesn't seem to connect to init process, when I checked using pstree command. I thought, the disown or nohup command detaches the process from its parent and attaches it to grand grand parent init process. And it disables SIGHUP signal to my script process. But the pstree command didn't show me what I expected. It still shows my script process attached to my current terminal process. I just don't understand the concept behind these two commands (nohup and disown). Is there any way, I can see the list of processes that are run by nohup or disown command?

View 2 Replies View Related

Programming :: Insert A Line In The Test File With Sed?

Jul 15, 2010

I have following file workers file: There are 800 entries like this.

# consensus/uat
worker.consensus-uat1.host=lonlx10409
worker.consensus-uat1.port=13702
worker.consensus-uat1.type=ajp13

[code]....

I want to insert one line just below the line starting with "woker.list". I think sed can do it but I am not aware.

View 14 Replies View Related







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