Sponsored Content
Top Forums Programming Help needed to Spawn Shell on Python and Continue Execution Post 303007145 by wisecracker on Sunday 12th of November 2017 01:19:09 PM
Old 11-12-2017
Quote:
Originally Posted by alvinoo
The shell does not spawn after I tried.
Well that is a useful reply - NOT!

If it is imperative to use 'xterm' then why not put your single line as a tiny script and call it something like:-
1) The script, say myscript.sh...
Code:
#!/bin/bash
tail -f /tmp/%/gobuster.txt
exit

2) And if you want python NOT to wait for it to finish; then...
Code:
os.system("xterm -e /your/path/to/myscript.sh &")

3) Or if you DO want python to wait for it to finish; then...
Code:
os.system("xterm -e /your/path/to/myscript.sh")

EDIT:
All this assumes you have imported 'os' into your python script...

Last edited by wisecracker; 11-12-2017 at 02:36 PM.. Reason: See EDIT above...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

KORN Shell - Spawn new shell with commands

I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server.. I have seen some code that may help - but I cant get it working as below: spawn /usr/bin/ksh send "telnet x <port_no>\r" expect "Enter command: " send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies

2. Shell Programming and Scripting

perl - understand process status and continue the code execution

Hello, I need advice on how to check if started processes are finished in perl, here's explanation : OS is RHEL 4, perl -v = "This is perl, v5.8.0 built for i386-linux-thread-multi" The logic of the script : #!/usr/bin/perl use warnings; $param1 = $ARGV; $param2 = $ARGV; $param3 =... (2 Replies)
Discussion started by: sysgate
2 Replies

3. Shell Programming and Scripting

shell script for getting pid of spawn processes from shell

Hi, I am new this forum. I request you peoples help in understanding and finding some solution to my problem. Here it goes: I need to perform this set of actions by writing a shell script. I need to read a config file for the bunch of processes to execute. I need to fecth the pid of... (4 Replies)
Discussion started by: sachin4sachi
4 Replies

4. UNIX for Dummies Questions & Answers

UNIX command to skip any warning messages and continue job execution

Hello All, Good day! This is my first UNIX post. :D Anyways, I would like to seek help from you guys if you know of any UNIX command that will skip a warning message once it is encountered but continue to run the execution. Ok here's the situation in general: An encypted file is sent to... (2 Replies)
Discussion started by: jennah_rekka
2 Replies

5. Programming

Python Execution Stack

I was wondering if Python's execution stack does not grow if we make recursive call of a function i.e. if we implement a fibonacci () and factorial () functions and made recursive call of them in a conditional statement the execution stack will not grow? I wish someone answer this question with... (1 Reply)
Discussion started by: pharaoh
1 Replies

6. Shell Programming and Scripting

how to continue shell script execution process without control going to pompt?

Hi Friends, Iam invoking another shell script to create B2k_session_id from my shell script.It is properly creating B2k_session_id and after creation control is coming out from the script and going to command prompt.The lines which are after the exectrusteduser.com sh.com are not executing..may... (5 Replies)
Discussion started by: vadlamudy
5 Replies

7. Shell Programming and Scripting

Spawn snmptrap from python

Hi I am trying to spawn an snmptrap from python but i keep getting the following error Invalid version specified after -v flag: 2c -c public 192.168.2.162 SNMPv2-SMI::enterprises.3.1.1 here is the python code i am using from subprocess import Popen Popen() When i test the same... (0 Replies)
Discussion started by: kaf3773
0 Replies

8. Shell Programming and Scripting

Help with spawn.. newbie to shell

Hi, I have a problem with the spawn execution with expect.. i have done the code for expect in a separate file and i am calling the this execution from the bash script.. as given below.. -bash-4.1$ cat main.sh #!/usr/bin/bash ./spawn.exp ========================== -bash-4.1$ cat... (2 Replies)
Discussion started by: satishkumar432
2 Replies

9. Shell Programming and Scripting

Continue Execution Based On List

Hi all. I have a script like this function check_filesize { filesize_1="$(ls -la "$1"|awk '{ print $5 }')" sleep 123 filesize_2="$(ls -la "$1"|awk '{ print $5 }')" if then echo "OK" else echo "NOT OK" sleep 1234 check_filesize $1 fi } function check_TR { chk="$(tail -1 $1|grep... (5 Replies)
Discussion started by: aimy
5 Replies

10. Shell Programming and Scripting

Python Thread Execution Issue . . .

Greetings! I set up a basic threading specimen which does the job:#!/usr/bin/python import threading class a(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): print("thread a finished") class b(threading.Thread): ... (0 Replies)
Discussion started by: LinQ
0 Replies
RESIZE(1)						      General Commands Manual							 RESIZE(1)

NAME
resize - set TERMCAP and terminal settings to current xterm window size SYNOPSIS
resize [ -u | -c ] [ -s [ row col ] ] DESCRIPTION
Resize prints a shell command for setting the TERM and TERMCAP environment variables to indicate the current size of xterm window from which the command is run. For this output to take effect, resize must either be evaluated as part of the command line (usually done with a shell alias or function) or else redirected to a file which can then be read in. From the C shell (usually known as /bin/csh), the follow- ing alias could be defined in the user's .cshrc: % alias rs 'set noglob; eval `resize`' After resizing the window, the user would type: % rs Users of versions of the Bourne shell (usually known as /bin/sh) that don't have command functions will need to send the output to a tempo- rary file and the read it back in with the ``.'' command: $ resize > /tmp/out $ . /tmp/out OPTIONS
The following options may be used with resize: -u This option indicates that Bourne shell commands should be generated even if the user's current shell isn't /bin/sh. -c This option indicates that C shell commands should be generated even if the user's current shell isn't /bin/csh. -s [rows columns] This option indicates that Sun console escape sequences will be used instead of the special xterm escape code. If rows and columns are given, resize will ask the xterm to resize itself. However, the window manager may choose to disallow the change. FILES
/etc/termcap for the base termcap entry to modify. ~/.cshrc user's alias for the command. SEE ALSO
csh(1), tset(1), xterm(1) AUTHORS
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley) Copyright (c) 1984, 1985 by X Consortium See X(1) for a complete copyright notice. BUGS
The -u or -c must appear to the left of -s if both are specified. X Version 11 Release 6.3 RESIZE(1)
All times are GMT -4. The time now is 10:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy