Skip to content
Advertisement

Tag: shell

How do I create the same directory in every subdirectories in bash?

I’ve been trying to create the directory “a” inside all the subdirectories of “example”. What I tried is the following: But it doesn’t take the ‘*’ as a wildcard, returning mkdir: can not create «example/*/a» directory: It doesn’t exist file or directory Note that I have too much subdirectories in example, so I can’t do it by creating a list.

Find and copy specific files by date

I’ve been trying to get a script working to backup some files from one machine to another but have been running into an issue. Basically what I want to do is copy two files, one .log and one (or more) .dmp. Their format is always as follows: something_2022_01_24.log something_2022_01_24.dmp I want to do three things with these files: find the

prompt and read a value as input for shell script

I am trying to create a shell script where it should prompt and read the values as input and then update the same shell script with that value in a specific line and column. Or if i can use another shell script to get the values and update original file. i wanted to read and update below parameters values as

Python different errors when executing in PyCharm and in shell

I’ve worked on my python project in PyCharm. When I’m executing its different files everything goes smoothly. However, when I’m executing the files in shell, it seems like I get errors that I don’t get in the IDE. For example, being a simplified structure of my project: And being a simplified main.py: The execution in PyCharm is clean, while when

Json response data extraction using linux command

Below is the json response of an api endpoint, I wanted to get the id value of specific name in the below array of json response. eg: I wanted to get id value(10002) of name test3, with the help of name key. Using jq I’m able to select the name key, but I’m not to find a way to get

shell script to pass argument to input file

I have shell script which takes some input from user and pass that input to the file which i am using inside my shell script Shell script myscript.sh here is de_pod.yaml this is how i am running the script if you look at de_pod.yaml at line command: [“python”, “/script.py”, “$Input1”, “$input2”] here i am using the user input after running

Advertisement