Skip to main content

All Questions

Tagged with
0 votes
1 answer
1k views

Shell script that prompts user for arguments and inserts them as parameters into a python script

I am trying to write a shell script that prompts the user for 3 case-sensitive arguments username password url and then take those parameters and calls a python script i.e.: "python streamcount....
Nick O'Neil's user avatar
1 vote
2 answers
2k views

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
  • 137
1 vote
1 answer
7k views

Run a Bash Script from Python and import the exported environment variables into Python

I have the following Bash script called Test_Vars.sh #!/bin/bash #----------------------------------------------------# # Environment Variables being used in the process # #------------------------...
roachd's user avatar
  • 11
0 votes
1 answer
1k views

Redirecting input from a file to a Python script fails but works with pipe

I have this python script: postpycess.py to draw data from a mesh file airfoil.p3d. This script was designed to work with input not using arguments, so I created an input file commands.txt and ...
IamNotaMathematician's user avatar
1 vote
1 answer
676 views

Specify which version of python duplicity should use

I've got a backup script that utilizes duplicity to upload to Dropbox. It's erroring out because the dropbox-python-sdk version required, 6.9.0, uses the keyword async which is now reserved in python3....
JacobTheDev's user avatar
0 votes
0 answers
3k views

Get environment variable from python script

I have bash script config.sh in which several variables are exported , and I need those variable in my python script. config.sh export VAR="YES" My approach is to source the config.sh from the ...
dejanualex's user avatar
0 votes
2 answers
1k views

How to run a python cmd inside a bash cmd over ssh

When I run the following in my bash terminal, it works fine. $ bash -c "python -c \"print 'helloworld'\"" ---> helloworld However when I try to do this over ssh, it give me nothing, can someone help ...
KN Nguyen's user avatar
22 votes
4 answers
60k views

Using Python in a Bash Script [duplicate]

If I try to start python in a bash script, the script will stop running and no commands will execute after "Python" is called. In this simple example, "TESTPRINT" will not be printed. It seems like ...
user364877's user avatar
1 vote
2 answers
341 views

Create several copies of file with one line in each copy changed

I have to automate simulations and to do so I need to create input files for each simulation. The majority of my simulations are almost identical, with one line of text changed from one file to the ...
Sinux1's user avatar
  • 39
0 votes
1 answer
86 views

Can I script recreation of files such their inodes/mtimes increase in filename order? Across subdirectories?

Long story short, I have a buggy Makefile that is missing a few prerequisite definitions and consequently accidentally relies on the "order" of files on disk (checked out from an SVN repo) as given by ...
Lightness Races in Orbit's user avatar
1 vote
1 answer
132 views

Scripting in Bash at an entry level job? [closed]

So, my question is how important is the ability to script in Bash or Python, etc., at an entry level position as a Linux Sys Admin? I'm sort of hedging that I will have time to develop those skill ...
user avatar
3 votes
2 answers
2k views

Script or Program to discover hosts on network

Explanation: I need a script or program to discover devices on my network. I was thinking maybe doing the scan with nmap and I need to display just the name of device, what it is, and also the ip ...
iamr00t's user avatar
  • 139
-1 votes
2 answers
544 views

Where can I practice my Python and Bash scripting? [closed]

I wanted to practice my bash scripting skills and python skills and wanted a good book or a site where I can practice and get excellent skills please. Any recommendations please.
BeachSamurai's user avatar
5 votes
3 answers
5k views

Wait until gnome-terminal ends

I'm trying to implement a script who runs four terminal window in parallel using this function gnome-terminal -e sh -c "python scraper.py". I would like to know if there's a way to wait until each ...
JJack_'s user avatar
  • 151
1 vote
2 answers
2k views

How can I run this python script on all html files under a directory? [duplicate]

I have a python script $ cat ~/script.py import sys from lxml import etree from lxml.html import parse doc = parse(sys.argv[1]) title = doc.find('//title') title.text = span2.text.strip() print etree....
Brian Fitzpatrick's user avatar

15 30 50 per page