Programming :: Generating Keyboard Events In Shell Script

Nov 23, 2010

Is it possible to generate keyboard event "Ctrl+c" from a shell script code.? I have written a shell script to compile my application and copy it to the server home directory, inorder to run my application I need to start the server (by running a shell script). But before that I need to stop the the currently running instance of my server. To do that I have to generate a keyboard event (Ctrl+c which I press it manually). I want to automate the entire process by writing a shell script I am able to run the server just by adding ./run.sh in my shell script. But before that to stop my server can I generate a keyboard by using a shell script event(ctrL+C) to stop server.?

View 2 Replies


ADVERTISEMENT

Programming :: Way To Capture X Keyboard Events

Jan 8, 2010

I wonder if there is a way to caputure all X keyboard events, blocking them from going to the window with keyboard focus?

View 4 Replies View Related

Programming :: Intercept The Mouse And Keyboard Events?

Nov 13, 2010

how to intercept the mouse and keyboard events in Linux,like hooking technique in Window ?

View 1 Replies View Related

Programming :: Capture/record The Keyboard And Mouse Events In Kde?

Aug 25, 2010

i want to capture the mouse events (click,double..,position ) as well as keyboard events (key strokes) for every application running separately?

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

Programming :: Keyboard Confirmation While Reading From File In Shell Script

Feb 3, 2010

I'm writing a script and I'm stuck. I need to read from keyboard to ask for confirmation while Im reading from a file. My code is this:

while read linea
do #code
echo "you sure? (y/n)"
read answer
#code
done < $"agenda.dat"

The problem is that stdinput has been redirected to file agenda.dat so when I do "read answer" it reads the next line from the file.

View 11 Replies View Related

Programming :: VB Scripting Worklsheet And Key Events?

Jan 18, 2011

am working an a worksheet where I need to lookup id in an other worksheet.The script works as long as I am staying on the same row. When pressing key up or enter the corresponmding lookup information is not placed on the very same row.In short terms, I want the lookup data to be enterd on the same row no matter what key I am pressing.

The script:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cfind As Range
On Error Resume Next
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
thisRow = ActiveCell.Row

[code].....

This example is set to Enter key procedure. So when the enter key is pressed, my current row will change by 1 so I have to compensate for that. All I want is that the data will be correctly enterd no matter what key I am pressing.

View 3 Replies View Related

Programming :: Simulate Key Strokes Events In Other Processes In System?

Feb 3, 2011

I have a program that receive user input.
I want to run this program automatically without user interaction, and in order to do that I need to simulate key events.
How can I do such a thing?

The program I am running is partly java and partly shell.

The shell part is easily done by using:
./prog.sh <parameters (Parameters being a file containing parameters)
But the java doesn't work similarly.

View 7 Replies View Related

Programming :: Capturing Short Randomly Occurring Events

May 8, 2011

I want to capture short randomly occurring events such as Sudden Interstellar Disturbances, Lightning, ion counting, etc. To do this I wish to use the LINE-IN port. My sensor would feed a signal of less that 2 volts but could be submitted via a voltage divider. Since the sound card captures 44100 events per second this should capture events I am looking at, I think, but maybe not. I would capture the sound buffer to a string or memory buffer every second (and half second so I can prevent overwriting of its buffer, then merge the two).

Every 60 seconds (for validation) I would run "time" and count full buffer transfers in between to time events. By effectively counting characters from the beginning of the processing buffer to the beginning of the event I could further refine the "time to event". I think I could then save a decent number of values or until no data received from the processing buffer to preserve the event. This I would output with event time (to within 1/44100 sec) along with the data points captured to a file.

Except for the outputting of info to a file I think I can scan a buffer for events within a second (while LINE-IN continues capturing data on that port). I believe I have a way to handle the outputting. I am asking if any of the processing of the previous buffer would interfere with the sound cards data capture on LINE-IN? There would be no disabling of interrupts. I am presuming that system interrupts would not effect the LINE-IN data capture. Is this true?

View 6 Replies View Related

Programming :: Generating Excel Charts From C?

Feb 24, 2011

how to generate excel charts from C, or if it's possible at all? For example, if I had 2 arrays that I wanted to export to excel and graph against each other. I know how to export it to a csv file, that's no problem, but I have no idea where to start with generating a graph of the data. I can't seem to find any examples anywhere. Just a simple example to show you what I mean: Code:

char arr1[] = {'a','b','c'};
int arr2[] = {10,20,30};
int main ()

[code]....

View 5 Replies View Related

Programming :: Code For Generating A Pop-Up Window In C

Aug 4, 2010

Unfortunatelly since i have no background at all about GUI programming, i dont know even the keyword for that i want to generate a pop up window from my program (written in C) which show a message and an OK button. in my opinion, maybe i should use directly the Xlib library and not the GTK or QT library for example so the program can work almost on every linux system. A code snippet/hint for the pop-up window then?

View 2 Replies View Related

Programming :: Generating Grpah Form Rrd On The Fly?

May 9, 2010

Im strugling with script that wil generate graph on demad. I put it in cgi-bin directory but cannot get it to work. i googled for perl generating images and tried few examples but none worked.

When I execute perl script in command line it throws picture i a bunch of characters so it creates it but wont show when I access it through a web page.

[Code]...

View 3 Replies View Related

Programming :: Generating Prime Numbers In C?

Mar 9, 2011

I'm trying to write a program that generates a random number and then tells if it is prime or not. I have doe some research about how to calculate prime and random numbers but I'm still having trouble. I don't really get how to calculate a prime number. I know a prime number is a number that is divisible by 1 and and itself. how to calculate a prime number in C?

View 10 Replies View Related

Programming :: Generating Timer Interrupts In C?

Jul 23, 2010

I'm trying to understand how interrupts work. Is there a way to generate timer interrupts in C. Also can we enter into the protected mode of the CPU. Does OS (specifically, linux) place any restrictions on user programs entering protected mode. If it does not, do we just have an assembly language program which changed the mode, followed by the C code... I'm just trying to understand how things work at the lowest level. So I'm trying to write few snippets to test my understanding.

View 3 Replies View Related

Programming :: Generating Series Of Numbers Of Sequence?

Mar 19, 2011

I am trying to generate sequence of number in the order of :

1
2
3
4

[Code]....

View 7 Replies View Related

Programming :: Generating Makefile Ans Configure Script ?

May 17, 2011

I know how to manually writing a makefile for my project, but I am new in using makefile & configure file generation tools like automake to generate a makefile and a configure script file.

I had done research on tutorials for generating makefile and configure script file.

I know that I need to manually write two files (makefile.am and configure.in).

I use wxWidgets GUI library, libconfig library, and libpcap library to do my project.

wx-config is a tool that can return the library files and include directory for wxWidgets library.

When using g++ to compile my files, I need to add in this line "`/wxlib/bin/wx-config --version=2.9 --static=yes --unicode=yes --debug=yes --libs`"

How to add that line to the makefile.am file?

View 1 Replies View Related

Programming :: Bash - Generating A Table With Aligned Fields

Apr 9, 2009

I want to write a function which calculates the space needed between fields, to generate a table with aligned fields, like when you type "ls -l", the operating system generates a table with beautifully aligned fields. I've got this code so far:

Code:

for line in $(cat tmpSearch)
do
line=`echo $line | tr ":" " "`

[code]....

View 2 Replies View Related

Programming :: AMD CPU Generating Way More System Load Than Intel Xeon CPU?

Oct 11, 2010

I am running some muti-threaded code that uses a lot of memory (~6GB). I have it compiled on a cluster that uses Xeon 5160 quad core CPUs with 4MB cache/core, 8GB of RAM and kernel 2.6.18 (x86_64) and I have also the same code compiled on another cluster that uses Opteron 2214 quad core CPUs with 1MB cache/core, 8GB of RAM and kernel 2.6.28 (x86_64). On the Intel cluster the code generates barely any system load when I look on top but on the AMD cluster it can generate over 50% of system load. On the intel machines my process can generate a constant load of 3, while the load generated by the process on the AMD machines is about 1.6.

Does anybody know what could cause this? Could it be the version of the kernel or the difference between the CPUs (for example, the much smaller cache of the AMD CPUS)? My software and all its dependencies are the same on both clusters. I am also using the exact same version of GCC to compile everything.

View 1 Replies View Related

Programming :: Bash: Generating A Random LETTERS Sequence?

May 12, 2011

I tried googling around but i cant find anything related to this: everyone seems just interested in random numbers, so when it comes to random letters there is a lack of informations. However, i am trying to figure out a wait to get a random letters string that matches a simple rule: it must be a sequence of consonant+vowel. So for example, these are some 6 letters strings i would like to obtain: wolupa, tafoke, zewevu, cupimo.

View 3 Replies View Related

Programming :: Generating Files With Different Names At Each Loop In Fortran?

Nov 7, 2010

I am trying to write a loop to open four main-data-files. At each open of the main-data-file, I want the loop to open another four sub-files and split the data from the mail-data-file according to the creteria and dump into the four files. When the loop goes to the second main-data-file, it shall generate another 4 sub-files with different file name. And the process goes on. That means I will have total of 16 sub files for the four main-data-files. Each four files from the 16 files shall have specific name on it. Based on the code which I given below, I would say when the file at UNIT=100 is opened, 4 new files needed to be opened as well. They are:

maximum_dist_001_064.dat
maximum_dist_065_128.dat
maximum_dist_129_192.dat
maximum_dist_193_256.dat

View 1 Replies View Related

Programming :: Generating Avi Files For Movies Directly From Gfortran Programs ?

Mar 5, 2011

Generating avi files for movies directly from gfortran programs. I make movies from my Fortran codes using seismic unix - SU. Need to modernize this method to make avi movies or something similar. I am quite adept at generating "C" binary files from Fortran. Have not been able to find the documented definition of AVI file format.

View 1 Replies View Related

Programming :: Create Awk Sript For Generating Two Files From A File Checking A Condition ?

Mar 3, 2010

I have a csv file like, having HDR segment and multiple LIN01 segment in each line:like

Here i want to split file in two, one having LIN01 segment which have LR at end, and one which have LF at end in LIN01 segment.

Is it possible to created awk or shell script for this?

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

Programming :: Read Keyboard Status (not: Wait For Keyboard Input)?

Jun 28, 2011

has bash a command that reads the keyboard status and exits? I want to write a loop of this form:

Code:
while [ 1 ] do
sleep (1)

[code]....

View 14 Replies View Related

Ubuntu :: Using A Keyboard Shortcut To Run A Shell Script?

Jul 28, 2010

Ubuntu 9.04

I have a bash shell script located at "/home/devin/.Scripts/script"

I want to attach it to a hot key, I go to "System > Preferences > Keyboard Shortcuts", click "Add", Type in a name, and under "Command" I put in "/home/devin/.Scripts/script", and then assign a key to it.

View 7 Replies View Related

Software :: Want To Change Keyboard Layout On Shell

Mar 13, 2009

I've installed fedora10 on my virtual machine under a OpenSuse10.3. When installing i ve chosen English language and French layout for keyboard. But any time i run fedora my kb is English and i cannot find how to change it
How can i do it using shell?

View 1 Replies View Related

Debian :: Choose Keyboard Model In Gnome Shell?

Jul 24, 2011

I've recently upgraded my squeeze to sid, then installed gnome shell as default window manager.

1. Gnome shell was normal until yesterday, I upgraded new packages up to date, then I cannot log into gnome shell any more (however, fallback mode is normal). It shows a sad computer screen with message "Oh no, something has gone wrong". The only thing I can do is pressing the logout button to log out.

2. Debian is running on my thinkpad T60p, and I can choose keyboard model in Gnome2, but I can't find any options in the system setting in Gnome shell to change keyboard layout for model IBM T60/R60.

View 3 Replies View Related

Ubuntu :: Unresponsive Keyboard At Root Shell Prompt?

Jan 28, 2011

I have no user name or password and cannot log in. In recovery mode, I after I enter "drop to root shell prompt" my keyboard does not respond when I try to "give root password for maintenance" or try to enter "Control-D" at the blinking cursor.

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







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