Skip to content
Advertisement

Tag: linux

Execute a command on all the files within a directory

I am trying to write a bash script that could automate a programme on all the files present in a directory. The files that are in my directory are in the .nii or .nii.gz format. The command that I have to write is InputFile is the name of the file that has to be processed by the programme, and OutputFile

Find and Execute Scripts in Subdirectories

I have a filesystem structured like this: Parent Directory orchestrator init.sh Subdir1 install.sh Subdir2 install.sh Subdir3 install.sh Within the init.sh, I have: This works for the most part, but it is fragile. If one of the install.sh scripts encounters a problem, the init.sh script stops. I’d like for it to continue on to the next install.sh script if this happens.

Understand shell script interpreter with custom shell [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 months ago. Improve this question I try to understood how shell script interpreter working. for example i wrote custom shell with c++ : now i wrote a script like this

How to save the text from a link in bash file?

I am trying to write a script that automatically makes a new website on my server. one of the steps is to go to this link and copy the salts into my wp-config.php file: https://api.wordpress.org/secret-key/1.1/salt/ I’m new to bash script and hoping this would be easy to do. I’m not sure if I need to save it as a text

Why are strings statically allocated in C?

In C (at least) local string variables are allocated in the .rodata section or .data segment generally. Why not store them on the stack, since it is a local variable? Will the string data be in memory for the full execution time? Is that not a waste of memory? Answer How have you drawn the conclusion that string is statically

How does the neofetch ascii logo determine which color to use?

I am making custom ascii text-images for a cli app, and was curious how these custom colors are designed. Any ideas? Thank you, Answer If you look at neofetch script on it github page, and search for any distro to see the ascii logo, you will see some codes between some letters, this codes are interpreted by the terminal as

awk the previous and current line only if equal to string

I have the following lines in a file I want to get the previous and current line, only if it start with albi. Means, output should look like: I tried the below, but looks I’m missing something: Answer Assuming you do need to test “shush” as in your script, all you were doing wrong is trying to reference an awk

Advertisement