All Questions
32 questions
0
votes
0
answers
206
views
Write output of multiple python scripts to single file
I used to have only one Python script, the output of which would be directed to a log file.
It works like this: I have it in autostart, using crontab
@reboot /bin/sleep 30; sudo /usr/bin/python3 -u /...
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....
1
vote
0
answers
307
views
progress bar for general non-looping script, or using multiple processes to write to stdout
How do I make a spinning wheel or progress bar that measures the progress of a very general script and I don't need or want to run it over anything looping or iterable? It doesn't need to be anywhere ...
0
votes
0
answers
23
views
My variable seems to change when passed into a CLI [duplicate]
I am attempting to use a java based program, CRFVoter, for text mining. I called and executed the script as specified.
[user]$ java -jar CRFVoter.jar
usage: CRFVoter GPRO
Command Line Tool for ...
0
votes
1
answer
442
views
Combine multiple CSV files with Same Header into multiple group files
Hi I am looking for a fastest solution to process loads of csv files.
Situation:
I have multiple csv files in a single folder with different headers
I have already done pre-processing on them to ...
8
votes
1
answer
2k
views
Bash completion appends a space after a word - how can I stop this?
I'm writing a tab completion script for Bash, using Python to deliver the results of the completion. I'm using a dummy script to show the problem I'm having, the content is not important.
I've got a ...
1
vote
1
answer
510
views
Verify SSH authentication with Bash Shell Script?
I need to test SSH authentication on a few servers. Let say the IP Addresses of those servers are saved in ip.txt file
I've written similar script in Python using paramiko and netmiko module.
The ...
0
votes
0
answers
51
views
Trigger bandwidth usage increase gradually by percentage with bash shell and python
I have a case monitoring bandwidth and trigger alert Telegram when network traffic increase 200% .
My idea:
Using vnStat print out traffic current , after 5 minutes print out traffic the second time .
...
0
votes
1
answer
2k
views
Invoking a complex find command from Python using subprocess
I'm currently making use of a complex find command to delete files that has a specific MIME type.
find -type f -exec bash -c '
for f; do
file=$(file -- "$f")
if [[ $file =~ ^$f:\ &...
0
votes
0
answers
551
views
Run an os.popen command requiring pseudo terminal from python in bash script
I have a python script which uses
size = os.popen('stty size', 'r').read().split()
to get the terminal window size so I can print text nicely. My problem arises when I have to run this python script ...
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 ...
-1
votes
1
answer
537
views
Repeat python command until x time has passed
I have the following problem, my python script due to some (known) reason crashes in the early running stages 99 out of 100 times. But as that program is not written by me I am not sure how to fix it. ...
1
vote
1
answer
225
views
Inside a bash function, how should I pipe output to a python program without invoking the python program, at definition time?
I apologize in advance, I'm not good at writing shell scripts.
I have a bash function that looks like this:
tagDownload() {
mp3 "$@" | /home/username/bin/tag.py
}
where mp3 is another bash ...
-2
votes
1
answer
423
views
Bash vs python for unix-related tasks [closed]
Even with experience in higher level programming languages, I am struggling with Bash to automate tasks (as a newbie of Unix - Linux Mint). The language is very powerful, but the learning curve is too ...
1
vote
1
answer
2k
views
How to procedurally generate command in bash script using string interpolation with spaces?
I'm trying to create a simple script that uses a list of months like this:
(Jan Feb)
To generate and execute this command:
python ExpenseManager.py -p Inputs/Jan\ 2019\ Debit.CSV Inputs/Jan\
...