Category "shell"

app.shell_context_processor decorator does not register the function as a shell context function

I created the following function in a microblog.py file in my ~/Programing/Rasa/myflaskapp/app folder. It creates a shell context that adds a database instance

Looping through all files in a directory [duplicate]

I want to write a shell script that will loop through all the files in a directory and echo "put ${filename}". Can anyone point me in the righ

How to install Python packages in a specific environment?

I installed Anaconda3 so I can create environments and install different packages in each environment. But I fail to understand the difference between the Pytho

Missing destination file operand?

I am simply trying to move a directory with subdirectories to another directory using CMDER. λ mv "c:\Program Files\ANOTHERTESTDIR\" c:\proj mv: missing

How to substitute alternate positions in a string using awk

I have a lookup file that I use to search the available records in file_2 and if such records are present then replace those records with #. Currently my code i

ffmpeg - how to handle video and audio URL's streams separately?

I am trying to create a zsh function that uses youtube-dl and ffmpeg to download a portion of a YouTube video. I did achieve this goal with the following functi

How to send JSON file as part of request body in CURL POST command

I am using CURL command line to send HTTP POST to a web service. I want to include a file's contents as a PART of the body of the POST command. Is this possible

How to get the length of the sum of audio files using sox?

I have a script such as following DIR=$1 ls $1 |sort -R |tail -$5 |while read file; do soxi -d $1$file done and it gives me an output like 00:40:35.18 00:4

cronjob error in OSX: "no path for address"

I tried running a Python script using cronjob but I get the following error: cron[44405]: no path for address 0x10ff7a000 in grep cron /var/log/system.log Whe

Tool sed-like to insert a HTML snippet code (a div block) after a <div id="jsn-page">...</div>

I am looking for a way to insert a block <div id="jsn-content-bottom">...code...</div> after a block <div id="jsn-body">...</div>. I wan

bjam: Unable to load Boost.Build: could not find "boost-build.jam"

When running the bjam command I always come up with the following error. I know I'm missing something like setting the env variables but not sure what should be

awk command to change date format

I have a file that contains the below records: **cat Date.txt** SEPT,30-SEP-2017 MARCH,30-MAR-2018 JULY,30-JUL-2017 DECEM,30-DEC-2017 AUGS,30-AUG-2017 I want

How to append json array using jq+shell in a loop?

I can create a json object with an array using jq like this echo '{"input":{"names":[]}}' | jq --arg val "alice" '.input.names[0] += $val'| jq --arg val "bob"

Change user (su) via Python script (pexpect, popen...)

I am running a Python script with user1 and in this script I need to move a file in a folder for which I don't have access. The folder is owned by user2. What

How to pass a string variable from shell script to python with sys.argv?

I would like to pass a string variable from a Shell Script to my python script and have it stored in sys.argv[1]. Currently, this is my situation: main.sh TEST=

jq how to pass json keys from a shell variable

I have a json file I am parsing with jq. This is a sample of the file [{ "key1":{...}, "key2":{...} }] [{ "key1":{...}, "key2":{...} }] ... each line is a list

How to Specifically Schedule Pipelines with Azure DevOps

How to schedule a one time run, non-repeating pipeline in AzurDevOps. I want to create this pipeline for our UAT environment, but I don't want to run it manuall

How to fix Python error "...failed to map segment from shared object" appearing when I try to import NumPy library on GCP?

I've recently started to use Google Cloud Platform and I run my python scripts in Cloud Shell within Linux environment. By running one of the scripts that is u

How can I loop with all the nc -zv connections?

I am trying to write a script to monitor all the server ports. But I am able write to for only one connection at a time. How can I write it for all the connecti

How to use zsh vcs_info with double quoted prompt?

this is my .zshrc file . vcs_info working for single quoted prompt but it's not working for double quoted prompt. autoload -Uz vcs_info zstyle ':vcs_info:*' ena