Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed last year. Improve this question I
Tag: bash
Looping over pairs of files
Hello I need to iterate over pairs of files and do something with them. For example I have 4 files which are named AA2234_1.fastq.gz AA2234_2.fastq.gz AA3945_1.fastq.gz AA3945_2.fastq.gz As you can propably tell the pairs are AA2234_1.fastq.gz <-> AA2234_2.fastq.gz and AA3945_1.fastq.gz <-> AA3945_2.fastq.gz (they share the name before _ sign) I have a command with syntax looking like this: initialize_of_command file1
Export variable containing special characters(args)
I want to export CELERY_ARGS CELERY_ARGS=”–prefetch-multiplier=1 –loglevel=info –concurrency=1″ But when I export, I get the following issue. Any suggestions. Thanks Answer Exporting isn’t something you do with a value; it’s something you do to a name. adds CELERY_ARGS to a list of variable names (if it isn’t already there) whose values should be added to the environment of a child
Cannot assign variable in for-loop in shell script
I tried to assign variable a in for-loop: But when I run, it gave error: Why did it give error? How to assign variable a? Answer There can be no spaces on both sides of the equal sign when defining variables in the Shell. It should be:
Linux “find” command and highlight filename [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 1 year ago. Improve this question I am using the Linux find command. It looks through all the *.jar files and their contents and finds the word “foo” in them but
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
Print the history for the last 10 Commands on the session on each log in to the shell
I’m trying to print out the last 10 commands on the last session on each login, in the bash.bashrc. I wrote this: But it didn’t print anything. Answer Bash history is only loaded from file after .bashrc has completed. You can force the loading of history and then output what you want by adding the following to your .bashrc file:
Regular expression operator {} in linux bash
I’m having some problems with the {} operator. In the following examples, I’m trying to find the rows with 1, 2, and 2 or more occurrences of the word mint, but I get a response only if I search for 1 occurrence of mint, even though there are more than 1 per row. The input I am processing is a
Getting bad substitution error in shell script
I have a variable COUNTRY=”INDIA” and another sets of variables:- INDIA_POPULATION=”5,00,00,000″, CHINA_POPULATION=”6,00,00,000″. In script I am trying to call them using command:- echo ${ ${COUNTRY}_POPULATION } But I am getting bad substitution error. Can someone please tell how to solve it ?? Answer You misplaced a bracket: {$COUNTRY}_POPULATION should be ${COUNTRY}_POPULATION. But even then it would not work as you
split directory with 10000 files into 2 directories [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I have directory /logos which contains approximately 10000 png images. Can you please suggest some script to make two new