10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I pass bash Variable to python script.
bash.sh
while read -r db
do
Printf "%s\n" ${db} "Found"
done < path/to/file.txt
file.txt
db1
db2
db3
python.py
print(${db}_tables.replicate.fix) (2 Replies)
Discussion started by: lpoolfc
2 Replies
2. Shell Programming and Scripting
On our server default python version is 2.6, how to enable rh-python34 via bash shell.
Thanks a lot for the helpful info. (7 Replies)
Discussion started by: cplusplus1
7 Replies
3. Shell Programming and Scripting
I have a bash shell script, within it i am using the below two commands . its failing right on scl enable command itself.
if i run it by itself without a shell, it works fine.
by default it is using pythin version 2.6 something. i want to use 3.4 version for that reason with in the shell... (3 Replies)
Discussion started by: cplusplus1
3 Replies
4. Shell Programming and Scripting
Hi everyone,
i have the following script.sh:
foo='lsusb | grep Webcam | cut -c16-18'
sudo /home/user/public/usbreset /dev/bus/usb/001/$foo
when i try to call this script from python using subprocess.call("script.sh", shell=True) it seems that only 'sudo /home/user/public/usbreset' is being... (6 Replies)
Discussion started by: hilfemir
6 Replies
5. Shell Programming and Scripting
Heyas
I've been working on my project TUI (Text User Interface) for quite some time now, its a hobby project, so nothing i sit in front of 8hrs/day.
Since the only 'real' programming language i knw is Visual Basic, based upon early steps with MS-Batch files. When i 'joined' linux 3 years ago,... (7 Replies)
Discussion started by: sea
7 Replies
6. Shell Programming and Scripting
I have 2 files generated in linux that has common output and were produced across multiple hosts with the same setup/configs. These files do some simple reporting on resource allocation and user sessions. So, essentially, say, 10 hosts, with the same (2) system reporting in the files, so a... (0 Replies)
Discussion started by: jdubbz
0 Replies
7. Shell Programming and Scripting
Hi,
I am trying to run a python script embedded in bash script. But is throwing me an error. Please help.
Script:
#!/bin/bash
nohup /usr/bin/python /opt/web/http.py &
Error:
/usr/bin/python: can't open file '/opt/web/http.py': No such file or directory
Please help me on this. (6 Replies)
Discussion started by: maddy26615
6 Replies
8. Shell Programming and Scripting
Hi all,
I need help figuring out why my script won't work when envoked from web interface. First off, I'm fairly new to Linux and Shell scripting so, my apologies for being ignorant!
So I have a python script that I envoke through a web interface. This script envokes my shell script and... (8 Replies)
Discussion started by: arod291
8 Replies
9. Programming
Hello,
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:
>>> import subprocess
>>> help(subprocess)
...
...
I'm hoping so as I hate scrolling and love how less works with... (0 Replies)
Discussion started by: Narnie
0 Replies
10. Shell Programming and Scripting
hey all!
i'm looking how to render verbose python scripts.
what i'm looking for would be an equivalent to a "bash -xf" in bash script headers..
Any help? (2 Replies)
Discussion started by: penguin-friend
2 Replies