bash

Add a column from a Pandas dataframe to a new dataframe [Solved]

Add a column from a Pandas dataframe to a new dataframe [Solved] Question: So I have a graph which I use to get the optimal path using Dijkstra. The path is returned as a list of index. I want to extract that path to a csv, but adding the coordinates to be able to visualize …

Total answers: 1

Bash check if file was modified within date range

Bash check if file was modified within date range Question: I have a script that checks to see if a cert, (.cer file), is within 14 days of expiring, and if it is, it will archive the old cert request, generate a new one, and send it to the middleware team. The thought occurs though, …

Total answers: 1

Extract a value from an array of data

Extract a value from an array of data Question: I get such an array of data [U8EUGGG1C32144101336_gulu, V5EUHHG1P12100100418_89011337751, V5EUHHG1P22111000028_89011337751] How I can extract only this value "89011337751" and write it to a variable ? Is it possible to do it with the bash, powershell or other scripts? Asked By: Vitaliy Kuzmenko || Source Answers: This …

Total answers: 1

Permission denied: calling a shell script from Python in a Jenkins job

Permission denied: calling a shell script from Python in a Jenkins job Question: Trying to provide the minimal amount of information necessary here, so I’ve left a lot out. Lots of similar questions around, but the most common answer (use chmod +x) isn’t working for me. I have a Python script and a shell script …

Total answers: 1

Removing Duplicate Domain URLs From the Text File Using Bash

Removing Duplicate Domain URLs From the Text File Using Bash Question: Text file https://www.google.com/1/ https://www.google.com/2/ https://www.google.com https://www.bing.com https://www.bing.com/2/ https://www.bing.com/3/ Expected Output: https://www.google.com/1/ https://www.bing.com What I Tried awk -F’/’ ‘!a[$3]++’ $file; Output https://www.google.com/1/ https://www.google.com https://www.bing.com https://www.bing.com/2/ I already tried various codes and none of them work as expected. I just want to pick only one unique …

Total answers: 2

Calling python script from bash script and getting it's return value

Calling python script from bash script and getting it's return value Question: I’ve bash script doing some tasks but I need to manipulate on string obtained from configuration (for simplification in this test it’s hardcoded). This manipulation can be done easily in python but is not simple in bash, so I’ve written a script in …

Total answers: 2

Passing arguments through Docker to argparse not working

Passing arguments through Docker to argparse not working Question: The setup I have a dockercontainer with the following Dockerfile: FROM python:3.10 WORKDIR /usr/src/app ENV ARGS="" COPY requirements.txt ./ COPY main.py ./ COPY … COPY … COPY … RUN apt update RUN apt install ffmpeg -y RUN apt install wkhtmltopdf -y RUN pip install –no-cache-dir -r …

Total answers: 1

sed and rev shell command into Python script

sed and rev shell command into Python script Question: There is a shell command, I am trying to convert the logic into python. But I don’t know what to do, I need some help with that. shell command is this : cd ../../../tests/src/main/test ls find . -name ‘*.vrlp’ | while read FILENAME do TEST_CASE=`echo $FILENAME …

Total answers: 1