Skip to main content

All Questions

Tagged with
22votes
5answers
14kviews

How can I have more than one possibility in a script's shebang line?

I'm in a bit of an interesting situation where I have a Python script that can theoretically be run by a variety of users with a variety of environments (and PATHs) and on a variety of Linux systems. ...
user108471's user avatar
1vote
1answer
706views

Simulating Keystrokes to a Telnet process

On my Linux system I have opened a Telnet session. On the other tab I am running a Python script and giving commands to the Telnet session using mkfifo file redirection. But I am not able to simulate ...
Anubhav Rai's user avatar
11votes
4answers
22kviews

Hybrid code in shell scripts. Sharing variables

This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is ...
Amelio Vazquez-Reina's user avatar
6votes
1answer
22kviews

How to run multiple scripts one after another but only after previous one got completed?

I have to run several python scripts one after another but want to make sure previous one got completed. How can I do that in Linux? Can it be done by simply using && or ; or | ?
Sam's user avatar
  • 71
5votes
4answers
39kviews

piping python variable value to bash script (inside python script)

After years of bash scripting I've been given the task of modifying a python script to have it call a shell script when certain conditions are met. That part wasn't too bad, but now I'm trying to ...
kadamwolfe's user avatar
5votes
1answer
7kviews

View script output over ssh in real time

I am trying to run a local script on a remote machine with ssh. Let's say this is the python script (printdelay.py) which I am trying to run: from time import sleep print("The first line") sleep(...
SauceCode's user avatar
1vote
2answers
2kviews

Running python script many times in a bash file

I want to run a python script many times with various arguments. To do that, I've written the following bash script: requests=(25 50 75 100) factors=(3 6) graphsizes=(25 50 75) for request in "${...
a6623's user avatar

close