Programming :: GDB Terminates When Spawned From Shell

Nov 22, 2010

I want to spawn a GDB session from bash script and keep it working to interact it from outside. But when I start it in background (with '&' sigil).

Code: gdb -x gdb_script.txt ./a.out < gdb_pipe.fifo &
It executes passed script and terminates by itself (I do not pass any data or signals to it)

Code: Breakpoint 33, main (argc=1, argv=0xbffff0f4) at main.c:53
---Type <return> to continue, or q <return> to quit---53
read_main_config();
(gdb) quit

A debugging session is active.
Inferior 1 [process 5957] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal] What can I do to make it alive?

View 1 Replies


ADVERTISEMENT

Programming :: Can Expect Return Control Of A Spawned Process To A Shell Script

Nov 19, 2009

Is it possible to have an Expect script spawn an SSH session, log in, then go into interactive mode and give control of the SSH session to a Bash script? Here's a simplified example of the script so far:

Code:
#!/bin/bash
expect -c "

[code]....

View 4 Replies View Related

Programming :: Expect: Prevent Output From Spawned Process To Appear On Stdout?

Jul 3, 2009

I have this expect process:

Code:
spawn -noecho telnet my.host.com
expect {

[code]...

View 3 Replies View Related

Programming :: How To Relaunch Process After It Terminates

Mar 1, 2010

I am trying to relaunch a process after it's name, not pid, terminates in C++. Is this possible? I am using g++ 4.3-4.4 on Fedora 10, wandering between my x86 and ppc machines. I just recompile.

View 3 Replies View Related

Programming :: Process P4 To Terminates Processes P1, P2, P3 If They Are Running?

Aug 18, 2009

I have p1,p2,p3,p4 some processes created by me in C. p1, p2, p3 are started individually from several consoles. And I want process p4 to terminates processes p1, p2, p3 if they are running. Which is the easiest way to accomplish that? put all processes in the same process group and send from p4 a kill signal to the group. But I couldn't do that because I cannot call successfully setpgid(getpid(), 15000) from p1-p4. It's there some way to put them in the same group? the processes don't have a child-parent relationship, they are launched manually from consoles.

View 1 Replies View Related

Server :: Finding Child Processes Spawned From Screen?

Aug 25, 2010

I have a situation where I have several screen (/usr/bin/screen) sessions running. 2 of the screen sessions (ps1 and ps2) run a script that launched SipP with specific parameters. 1 script starts SipP and has it make 50 calls where the other makes only 20 calls. However The script is configured where we can change how many calls it makes if needed.

So the problem is, due to issues with SipP, we must restart everything every 12 hours (at maximum). So I am trying to work out scripts to stop the SipP processes cleanly. In order to do so I need to figure out which SipP process is spawned by which screen. i.e. which sipp was started by screen session ps1, and which one was started by screen session ps2.

Now I can do ps -ef | grep <number of calls configured> to find out but then I would have to change my stop script every time we reconfigure how many calls are made, and have a separate stop script for each screen session. I would much rather be able to send the screen name as a parameter to the stop script and have it work no matter how many calls SipP is configured to make.Also your standard kill -1 <PID> does not shutdown SipP cleanly. So working out those details is a bit more tricky. Anyone know how I can determine what processes are spawned from a specific screen session?

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

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 :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

OpenSUSE Install :: Installer Terminates Prematurely - Error 15

Dec 23, 2010

I tried to install 11.3 today but no luck so far. I installed it 3 times from GNOME liveCD and once from a LiveUSB both didn't work. With the CD, it restarts before installing initrd, GRUB tells me :
error 15 : file not found.
I verified both the image I downloaded via md5 and the CD I made and they both are OK.

View 9 Replies View Related

Ubuntu Networking :: Kppp: Pppd Terminates On Signal 15?

Dec 14, 2010

I am using kppp in ubuntu10.10 to connect via my samsung c3010 mobile and Airtel connection. But when I dial through it, it terminates on signal 15! Some requests are rejected it seems. I am pasting the log:

Dec 14 20:08:02 pratik pppd[1883]: pppd 2.4.5 started by pratik, uid 1000
Dec 14 20:08:02 pratik pppd[1883]: using channel 5
Dec 14 20:08:02 pratik pppd[1883]: Using interface ppp0
Dec 14 20:08:02 pratik pppd[1883]: Connect: ppp0 <--> /dev/ttyACM0

[Code]....

I am connecting the modem over USB. The GUI shows me it is dialling the number, and then connecting to the network, and after a while ( it sends it 9 times it seems) it terminates.

View 9 Replies View Related

General :: Loop Terminates / Quits After Single Cycle

Jul 14, 2011

I tried to find an answer to whatever is happening with my sh, tried a few approaches, but none is working the way I planned... the loop quits with exit 0, runs once, if I comment out 'ffmpeg' line, it runs N times as it should - ffmpeg does not error out other than 0.

Code:
find . | grep .mp3 | while read filename do
newfilename=`echo "$filename" | tr ".mp3" ".ogg"`
ffmpeg -i "$filename" -acodec libvorbis -ac 2 -aq 4 -y "$newfilename"
echo inside #4debug
done
echo outside

This sh runs once, echoes "inside" 'n "outside" once, exits with '0'... unless ffmpeg commented out. I also tried to feed the loop with: done < /tmp/fname.list. BTW, this works well - but I am very interested in the >while read< loop giving up.

Code:
for i in *.mp3; do ffmpeg -i "$i" -acodec libvorbis -ac 2 -aq 4 -y "$(basename "$i" .mp3).ogg"; done

View 3 Replies View Related

General :: Internet Broadband Connection Terminates Abruptly

Sep 4, 2010

I use ubuntu 9.10 karmic koala as my desktop OS. My internet connection is creating problems these days, ever since I started downloading torrents for iso files. Whenever the downloads in transmission client is running, the internet gets disconnected abruptly, and even my other downloads in d4x stops. On using the plog command in the terminal, it shows the following:

Sep 5 03:32:57 gunjan pppd[3241]: LCP terminated by peer
Sep 5 03:32:57 gunjan pppd[3241]: Connect time 4.5 minutes.
Sep 5 03:32:57 gunjan pppd[3241]: Sent 2102494 bytes, received 31842568 bytes.
Sep 5 03:33:00 gunjan pppd[3241]: Connection terminated.
Sep 5 03:33:00 gunjan pppd[3241]: Modem hangup
Sep 5 03:34:05 gunjan pppd[3241]: Timeout waiting for PADO packets
Sep 5 03:34:05 gunjan pppd[3241]: Unable to complete PPPoE Discovery
Sep 5 03:35:10 gunjan pppd[3241]: Timeout waiting for PADO packets
Sep 5 03:35:10 gunjan pppd[3241]: Unable to complete PPPoE Discovery

I dont understand much of it, as am a new user using linux systems from only a few months ago, can't find out. Also on closing the transmission client the other downloads in d4x run perfectly well and so does my internet connection.

View 1 Replies View Related

Ubuntu Installation :: Booting Stops - Networking Terminates With Status 1

Apr 1, 2010

We are running Ubuntu on VMWare EXS Server 3i (32 bit server). We tried upgrading from Version 9.4 to 9.10. The server will not boot. It throws networking errors then just comes to a blank black screen.

Here is most of the screen:
/dev/sda5 was not cleanly unmounted, check forced. (note - this is due to having turned it off at the black screen - that much I get)
/dev/sdd1: recovering journal
/dev/sdb1: recovering journal
/dev/sdc1: recovering journal
/dev/sdb1: clean, 74772/6553600 files, 15793957/26214055 blocks (check in 5 mounts)
/dev/sdd1: clean, 22599/6553600 files, 15036060/26214055 blocks
/dev/sdc1: clean, 381500/13107200 files, 34291998/52428119 blocks
Filesystem checks are in progress (ESC to cancel):
***** here is where I think things are going bad ************
init: network-interface (eth0) pre-start process (535) terminated with status 1
init: network-interface (eth0) post-stop process(61 terminated with status 1
init: network-interface (lo) pre-start process (615) terminated with status 1
init: network-interface (lo) post-stop process(62 terminated with status 1
/dev/sda5: 105/124496 files (34.3% non-contiguous), 18894/.248976 blocks
mountall: fsck /boot [410] terminated with status 1
fsck from util-linux-ng 2.16
/dev/FileU32-root: clean, 69429/734400 files, 540860/2933760 blocks
init: networking main process (70 terminated with status 1

View 3 Replies View Related

Ubuntu :: Wally 2.4 - Command Line - As Soon As Close My Terminal - Terminates

Sep 24, 2010

I am using Ubuntu 10.04 and installed Wally 2.4.

I have few questions:

1) Currently I run wally with command line by running

Code:

It works, but as soon as I close my terminal, wally terminates. Is there anyway I can make it not terminate?

2) why is that option disabled?

View 4 Replies View Related

Ubuntu Security :: GKSU Terminates After 1 Incorrect Password Attempt

Nov 19, 2010

Just like the title says, if I were to try to run anything through gksu and accidentally put in an incorrect password, instead of the gksu window coming up again, it would just terminate.

Code:
theyain@theyain-laptop:~$ gksu update-manager
GNOME_SUDO_PASSGNOME_SUDO_PASSSorry, try again.
sudo: 3 incorrect password attempts

Whats interesting is that it gives me the sudo error after only one incorrect password attempt.

View 8 Replies View Related

General :: Pardus Upgrade Failed - PISI Terminates After Checking

Apr 11, 2010

I did an upgrade from pardus 2009 to 2009.1. When all the packages finished downloading and started installing, the power went off suddenly. Now my system is boots fine till the graphical login, but after I enter username and password, desktop fails to load and I am back at the login screen. I tried to resume the upgrade using (# pisi upgrade) but pisi terminates after checking the repositories. What to do?

View 2 Replies View Related

Programming :: Possible To Assist In Programming Shell Scripts?

May 17, 2010

Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other

View 1 Replies View Related

General :: Firefox Terminates If Multiple Instances Of Flash Player Running?

Feb 17, 2010

If i have, say, ..... tab opened and if a click on some of the related videos (while it's still playing) firefox terminates. The same if I open ..... on one tab and myspace on another - firefox just shuts down.

I want to know why this happens, is it a bug and how can i fix it ?

View 2 Replies View Related

Slackware :: Firefox Terminates If Multiple Instances Of Flash Player Running?

Feb 17, 2010

..... tab opened and if a click on some of the related videos (while it's still playing) firefox terminates. The same if I open ..... on one tab and myspace on another - firefox just shuts down.I want to know why this happens, is it a bug and how can i fix it ?

View 2 Replies View Related

Programming :: How To Turn Non-interactive Shell Into Interactive Shell?

Feb 4, 2011

I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.

Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.

View 2 Replies View Related

Programming :: Shell Script To Tee ITSELF

Dec 10, 2008

I have a shell script that I would like to log to stdout and also to a file.....much like using tee. I would like to, instead of calling the script and piping to tee...i would like for the script to tee itself.

View 4 Replies View Related

Programming :: How To Create Own C Shell

Jul 11, 2010

i got to build my own linux shell for my project

View 5 Replies View Related

Programming :: Can Awk Take A Shell Variable

Jul 23, 2010

I have been searching most of today and am stuck on getting a variable into an awk portion of my bash script. I have this working:

Code:

#!/bin/sh
SRC=/var/log/mail.log
DEST=/var/www/output/myFile.txt
VAR=userName@myDomain.tld

[code]....

Can awk take a shell variable? Or do I have to do something completely different?

View 11 Replies View Related

Programming :: How To Use Scp In A Shell Script

Apr 2, 2011

I need to push out a file to a bunch of linux and solaris boxes so I was hoping to use a script to automate the process with scp (or something else / better) - how can I batchmode scp so that it will do this? I should mention the servers do have keys set up so I do not have to authenticate manually or through something like an expect script...

View 4 Replies View Related

Programming :: Reg Sed On Shell Script?

Feb 16, 2010

I am having a shell script with following lines

ORIG_LOG_ARCHIVE_FORMAT=`grep log_archive_format $LOG_DIR/init$CLONE_DB.ora | cut -d"=" -f2`
SRC_LOG_ARCHIVE_FORMAT=`sqlplus -s "/ as sysdba" @$SCRIPTS_DIR/log_archive_format.sql`
echo $ORIG_LOG_ARCHIVE_FORMAT

[code]...

When I execute this script I am getting below output

'enin16_%t_%s_%r.arc'
enip131_%t_%s_%r.arc
sed: command garbled: s/'enin16_%t_%s_%r.arc'/

However when I do the exact above command on unix prompt (refer below) after setting values for all variables, it is not giving sed garbled error message. May I know what should I do to make it work inside the script as well?

$ cat init_refresh$CLONE_DB.ora | sed "s/$ORIG_LOG_ARCHIVE_FORMAT/$SRC_LOG_ARCHIVE_FORMAT/g" > $LOG_DIR/init_refresh1$CLONE_DB.ora
$

View 3 Replies View Related

Programming :: How To Write A Toy Shell

Mar 24, 2011

I'm trying to write a toy linux shell. For starters this is what I'm trying to do:

1. Start a new process with fork.

2. Execute a program in the new process with execl().

3. Redirect the output from the new process from STDOUT to another file descriptor, using dup2(2).

4. In the parent process, read the output from the child process and write it to the screen.

Creating a new process and executing a program in it is no problems, the problem is that I can't seem to capture the output from it in the parent process.

Code:

//digenv
//C++arl 2011-03-24
#include <stdio.h>
#include <sys/types.h>

[code]...

View 14 Replies View Related

Debian Programming :: How To Use Shell Command

Sep 6, 2013

How to use shell command?

installs.sh:

Code: Select allapt-get install icedove-l10n-hu
apt-get install rar
apt-get install ...
...
y press key or other language is other key. hungarian key is: i

english after apt-get install in gnome-terminal: (y)es or (n)o
hungarian after apt-get install in gnome-terminal: (i)gen or (n)em

How to yes or no automatically in all languages? Not manual, not 'Y'/'I' or 'N'/'N' keydown.

I would like use this script my fresh installed Debian 7.1. I would like run this install.sh when Debian is installed for my all softwares when i would like use.

10 PC installing easy and faster my script.

If no script is slowly install for my 10 PC.

View 2 Replies View Related

Programming :: Detection Of A Command In Shell?

Apr 2, 2010

I would like to know if there is any way to detect a command if it going to be executed in the shell?

Eg:
Cmd: sudo apt-get clean I want a C program to be called before this cmd is executed.

View 8 Replies View Related







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