Ubuntu :: Bash - How To Define An Error Handler

Sep 29, 2010

I want to define a simple error handler for a script. Image a script that does a few commands:

Code:

ls .
cd ..
touch ...

whatever, it doesn't matter. I want to define one error handler for the script, so if any of the steps error than the script is terminated and the error handler is run. I see the -e option to quit on errors, but I want a GOTO on errors.

View 1 Replies


ADVERTISEMENT

Programming :: BASH: Read + Define + Modify A Numeric Value From/to A File?

Mar 25, 2010

I want my bash file to read from "input.dat" the two values emin emax. My input file looks like that:

#cat input.dat
!Energies
emin 10.00 !minimum energy
emax 30.00 !maximum energy

Now this seems to be not so hard with the command awk

#!/bin/bash
awk '{FS=" "}/emin/{print $2}' input.dat
awk '{FS=" "}/emax/{print $2}' input.dat

[code]....

So far so good. Now, I want to define two variables (e.g. e1,e2) in the bash file, so that their values would correspond to 00.00 and 30.00, as read from the input file. This one I have not found yet, thus asking for your advice. At the end, writing echo $e1 $e2, I should get 10.00 30.00 This is even harder to me: I want to replace the values emin,emax in a new file "modify.dat" which looks like that:

...
c---- energy interval
emin = 1.00
emax = 2.00
...

with the values e1 and e2 I have in my bash file. In other words, I want to call "modify.dat", find these two lines and replace the numeric values with the e1 and e2. At the end, my file should be like:

...
c---- energy interval
emin = 10.00
emax = 30.00
...

View 3 Replies View Related

OpenSUSE :: 11.3 - Kernel Error No Irq Handler

Oct 11, 2010

I recently installed openSUSE 11.3 (4 times, I think, which gives me always a new name for the "server" and in my terminal screen I continuously get this error: Message from syslcgd@linux-i4cz at Oct 12 06:21:57 ... kernel:[2866.05E384] do_IRQ: 0.91 No irq handler for vector (irq -1) the number after kernel: varies I then hit a few time son the [I]enter[I] key and then I get my linux prompt.

View 2 Replies View Related

Fedora :: Error Message: Sox Formats: No Handler For File Extension `mp3'

Aug 23, 2010

Odd that no posts come up in the search for "sox" or "specifically sox mp3"

How to get it up and going?

Which yum libraries need to be installed to get sox to recognize mp3s,

example: yum -y install force-mp3-to-start-working

its producing this error message: sox formats: no handler for file extension `mp3'

View 10 Replies View Related

Ubuntu :: Play In Terminal Get The Error " No Handler For File Extension 'mp3' "?

Mar 3, 2011

I have just installed the play command in my terminal and when I try to play an mp3 i get the error " no handler for file extension 'mp3' ".Am I required to create a default action that happens when an mp3 file is called, like opening and audio player, or do I just need to install some specific drivers?

View 5 Replies View Related

Ubuntu Multimedia :: "No URI Handler Implemented" Dvd Error

Jan 28, 2010

my computer doesn't get the internet, so I've tried to download what earlier threads write as the solution on another computer, but the other computer isn't linux, and it says that it doesn't recognize the file extension. Is there any way to download the "ubuntu-restricted-extras" thingy without it immediately trying to install?

(I have ubuntu 9.1, on a thinkpad t22(i think))

View 1 Replies View Related

Ubuntu :: Error: " No URI Handler Implemented For "mmsh"

Apr 12, 2010

I'm sure this is a simple problem, however I am a newly reformed microsoft user (and it feels great).

When I try to watch wmv streams I get the error: No URI handler implemented for "mmsh".

View 2 Replies View Related

Ubuntu :: Create New Directory But Keep Getting Same Error - Bash: Syntax Error Near Unexpected Token `newline'

Jan 13, 2010

I'm trying to create a new directory using the mkdir command.

Code:

home@ubuntu:~$ mkdir <aicoursework>
bash: syntax error near unexpected token `newline'

that's the error that i keep getting, what am i doing wrong?

View 5 Replies View Related

Ubuntu :: ERROR --bash: Syntax Error Near Unexpected Token 2

Feb 4, 2010

The following problem occurs to me, I'm creating a distribution (as a class project) for my school (I'm studying telecommunications and computer systems). I am following, in order to create the distribution, the manual that you can find on this page: [URL] But when I get to write:

[Code]...

View 3 Replies View Related

General :: Bash Error - Syntax Error Near Unexpected Token `{

Mar 4, 2010

I am new to shell scripting, bash specifically.

I am trying to run the following script:

Code:

When trying to execute I always get this error:

Code:

In case you need to know the permissions. Here is it:

Code:

I run the script using the following command:

Code:

View 1 Replies View Related

Ubuntu :: Playing DVDs - No URI Handler Implemented

Apr 17, 2010

Ubunto is new to me when I try to play a movie I get the message, "no URI handler implemented for dvd".

View 1 Replies View Related

General :: Set Handler Php Without Panel?

Feb 23, 2010

How can I set the handler without panel?

like when it's set to dso without panel

and next my qus is :

where is mod_cgi.so in whm panel ? i want edit this file but i can not found this file

View 1 Replies View Related

Software :: Pty Handler Program ?

Dec 30, 2009

I'd like to propose the following program, which I might write if nothing like this already exists. It would be similar to the "script" program in that it will allocate a new pty/tty pair and start a new session. But unlike the "script" program, it will provide a means to have BOTH the normal terminal session going AND a script or input source to provide input. It could be used, for example, to pre-start programs inside the pty session, and at the end, let the controlling tty it was started in fully interact with it (something that can't happen if it was started with input piped from the script).

My design would allow running a control script right from the beginning, or at any later time. The control script can see output from the session, filter that output for the controlling tty to see, provide input, maybe even filter the controlling tty input, too. When the script ends, the session can remain for regular interaction. Also, an environment variable will be set in the session to allow programs inside the session to provide similar controls, such as feeding input. That environment variable might be a local port number to connect to, with an access key or encryption key, to provide input and/or control commands.

I have several uses for this. Many of those uses could be done using other tools, but not all the uses would hit the same tools. But by doing it all in a program like this, I see a great many of my uses all solved in a single project, even if it isn't the most elegant (but I see solving many problems with one solution as being its own kind of elegant).

View 1 Replies View Related

OpenSUSE :: Looking For Audio Session Handler?

May 22, 2010

I am looking for a good audio session handler.
On ubuntu I have seen Ladish but it is a preview release.
Is there a good audio session handler for openSUSE.
http://ladish.org/wiki/demovideo

View 4 Replies View Related

General :: Blocking Or Sleeping An Interrupt Handler?

Dec 2, 2010

Assume: 1) Multi-cpu environment 2) Process that gets interrupted, is the same process that executes the interrupt handler, so I guess technically nothing gets interrupted except what the process was doing before, but it is still executing as it is executing the handler. 3) There is no top or bottom half, when an interrupt takes place the handler is invoked, executes, then return from interrupt, simple as that.

Why would sleeping the handler (puts in sleep queue, context switch to next runnable process) be a bad idea?

View 1 Replies View Related

Programming :: Possible To Connect A Signal Handler To A Variable?

Nov 1, 2010

Is it possible to connect a signal handler to a variable?So when the variable changes the signal handler is called.I have a vector containing strings which i want to parse when there are one or more available strings in the vector

View 3 Replies View Related

Fedora :: Document Handler / Organizer Software?

Oct 29, 2010

What is Fedora's best document organizer software? All the best, Novatian.

View 2 Replies View Related

Debian Programming :: Serial Port Signal Handler

Jan 14, 2015

Basically I'm intending to write serial RX signal handler.Application receives defined packages of data over serial which contains header and payload. Handler should analyse incoming stream and upon detection of header (header is 6B in length) switches to receive payload of length defined in header, then after receiving full message packs it and sends to application for handling.Problem I'm facing is that at random moments in signal I receive errors that "Resource temporarily unavailable" while reading from ttyOx device and I see that sometimes I miss incoming data.Also is it possible that if while I'm handling signal one more signal arrives and it is started to be handled parallel? If it is, what are the ways to prevent it? So I would be sure that no more signals will fire on same peripheral until I will finish handling what I have on my hands now.

Serial open and init:
Code: Select allint open_port(int port_nr) {
    int fd; /* File descriptor for the port */
    switch (port_nr) {
    case 1:
        fd = open("/dev/ttyO1", O_RDWR | O_NOCTTY | O_NDELAY);
        break;
   
[code]....

View 5 Replies View Related

Programming :: Panic - Killing Interrupt Handler - Not Syncing

May 10, 2010

I have written a Linux kernel module (in Linux 2.4, Red Hat 9) which does the followings: It takes srcIP, sourceport, destIP, destport and loadvalue as command line arguments. If configured load value is greater than 1, it creates different channels (i.e. No of UDP channels created equals to configured load value), assign different source port and destination port to different channels and send UDP datagram in different channels. Say for example the configured parameters are as follows srcIP=10.17.17.43 destIP= 10.17.17.44 sourceport=10000 destport= 20000 loadvalue=2.

Then it creates two UDP different channels and transmits UDP packets (in every 20 milliseconds) to destination IP address (i.e., 10.17.17.44) with source port 10000, destination port 20000 in one channel and source port 10002, destination port 20000 in another channel. When I configure to pass ?loadvalue=500? and run the module, I get the below kernel panic message in system log file (i.e., var/log/messages) 0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing. Running the same linux kernel module ,in 1000 loadvalue, I get this message, eth0: Out-of-sync dirty pointer, 49937 vs. 49954 in text console. I am unable to catch the root cause of these problems and how will I solve these?

View 1 Replies View Related

General :: Select PHP Handler Module Per Virtual Host?

Oct 20, 2010

I would really like to install 2 or 3 PHP handler modules (suEXEC, FastCGI, etc) on a single server and assign which module should be used per virtual host or domain or whatever.

Is this possible?!
Could I get details?

View 1 Replies View Related

Software :: Wine Set It As Default Handler For Many Mime-types?

Dec 24, 2010

I don't have wine installed. But I use teamviewer [URL] to remote support my friends. Teamviewer provide an "linux version" using wine wrapper. Every time I run it, some mime types such as .jpg, .wmv, .txt, .ini, v.v... was set to be handle by a "A Wine application". So, nothing happen when I open those file, I have to reset their handler to proper linux application.

1. How can I completely remove those "A wine application" handler? Is there a tool, or a settings applet in gnome that allow me to do that. Currently, I have to find those files in nautilus, right click and change the open with settings, that's frustrated.

2. Can I lock mime type handling settings from being changed by some application? Or even lock it from any changed at all? I don't mind remove the write permission from some settings file, I won't likely to change my current mime type handling settings in near future.

View 4 Replies View Related

Programming :: Catching Multiple Signals In A Single Handler In C?

Apr 26, 2011

Is it possible to handle multiple signals in just one handler? I only know singal() catches one signal at a time

View 2 Replies View Related

Programming :: Locking Mutex In A Signal Handler Function?

Feb 15, 2010

locking mutex (phtread_t type) in a signal handler function (installed by function signal()) for Linux. It seems that if the mutex has been previously locked by another thread outside the signal handler function and then the signal handler function tries to lock it, the whole process hangs.

View 5 Replies View Related

Programming :: Designing A Signal Handler With Sigwait In UNIX?

Jan 20, 2010

I'm new to Unix and every signal handler algorithm I've seen is more or less a copy of what I'm trying to do.[URL] designing a signal handler with sigwait in UNIX?

View 1 Replies View Related

General :: Create A Signal Handler Thread To Handle SIGALRM Signals?

Jan 19, 2010

I'm trying to create a signal handler thread to handle SIGALRM signals. The main thread calls the following function before creating any other threads

Code:

pthread_t Timer::Init(long _clock_interval_musec)
{
// Set interval.
clock_interval = _clock_interval_musec;
// This is called while in a single threaded environment.

[code]....

clock_interval is 50.

Is the timer not firing? Did I not set my interval correctly? Did I not proper block the signals ensuring the that the default handler would not take care of them?

View 7 Replies View Related

Ubuntu :: Define Words In Terminal

Nov 29, 2010

I am looking for a program that will allow me to type a command to quickly define a word. Something like this: Code: dic piquant

1. Having a pleasantly sharp taste or appetizing flavor.
2. Pleasantly stimulating or exciting to the mind

View 3 Replies View Related

Ubuntu Networking :: Define Multiple Ip Address On NIC?

Apr 12, 2011

i was installed two ubuntu(1,2) via wmware on my laptop(win=7) on one of them run dhcpserver (ubuntu-1) and i am going to run the other one dhcp client(ubuntu-2) but on the one NIC that belong to my laptop how to config dhcp client (ununtu-2) get ip adres fom dhcserver(ubuntu 1)

View 3 Replies View Related

Ubuntu :: 10.10 - Cannot Detect Subdirectory (Bash CD Error)

Dec 21, 2010

I'm trying to change to a subdirectory:
Code:
tony@advent:~/scratch$ cd Home-Arch
bash: cd: Home-Arch: No such file or directory

So I list the contents of the current directory:
Code:
tony@advent:~/scratch$ ls
duhome Home-Arch qcad_1.dxf qcad_1.svg runme stdout

OK, I assume I have mis-typed the subdirectory name in ways I cannot detect, so I copy the sub-directory name from the output of the 'ls' command, while within the terminal window, and paste it into the next 'cd' command:

Code:
tony@advent:~/scratch$ cd Home-Arch
bash: cd: Home-Arch: No such file or directory

I browse the directory and sub-directory in Nautlius - everything is there where I expect it to be. The folders/files are not hidden. What is happening here?

View 8 Replies View Related

Ubuntu :: Bash Error When Launching A File?

Jun 8, 2011

This is my problem

bash: /usr/local/uvlayout-pro/bin/headus: No such file or directory

but the file exists. If I uncheck the Allow execute as a program the error is

bash: /usr/local/uvlayout-pro/bin/headus: permission denied

I used the sudo command.

(I tried to change the folder permissions to read and write, cause if I didn't, then the file, when not in nautilus, had an x in the top right of the icon. Before this it didn't work anyway)

View 6 Replies View Related

Networking :: How To Define Ssh Users

Dec 18, 2010

How can I define some users as ssh user( ssh to linux remotely ) and the others not ( do not ssh)?

View 4 Replies View Related







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