The main folder “Main” contains multiple subfolders (6900,159, 9997, …) and each subfolder contains 8 items (4 files (6900Log.final.out, 6900Log.out, 6900Log.progress.out, 6900SJ.out.tab), 3 folders (6900_STARgenome, 6900_STARpass1, 6900_STARtmp), and one compressed file (6900Aligned.sortedByCoord.out.bam)). The 6900_STARtmp contain further subfolders but I don’t want to change name of sub folders present in 6900_STARtmp. Please see the image I want to remove 6900 from
Tag: for-loop
for loop in bash simply prints n times the command instead of reiterating
I have a input.txt file with over 6000 lines. If a line a has over 10 words then I want it to be split but not at the 10th word but where the first comma character appears. And, if the new line also has more than 10 words, then it should also be split, and keep reiterating this process 7
Bash loop only read the last line
I have problems trying to extract data behind colons in multiple lines using while loop and awk. This is my data structure: What I want to get is the BioSample ID, which is like SAMD00019077. Scripts I tried: while read line ; do echo $line | awk -F’:’ ‘{print $3}’ > 1.tmp2 ; done < 1.tmp for line incat 1.tmp;
Bash for loop on two arrays
I have two arrays that I need to iterate over but I can’t figure out how to get the combination of both arrays… Answer
using for in loop with sql output
I have a roles.txt file that contains SELECT ROLE_NAME FROM SENTRY_ROLE WHERE ROLE_NAME produces: Im trying to echo all the roles from roles.txt that are not in the sql_output (user in this example). This is what i have so far: Answer That’s not how you iterate over the lines of a file. See http://mywiki.wooledge.org/BashFAQ/001 I would do this, with a
redirect and print script output using for loop and awk in linux
I have a script which give out put like this : my_script <variables> output like this : now I want to redirect the output and print like this print “some_text col_3@col_4 some_more_text col_4” ans will be like this: some_text textext3@texxt6 some_more_text texxt6 some_text textext1@text4 some_more_text text4 some_text text5@textxt0 some_more_text textxt0 ….. so on col_3 = all values in column 3,
Moves files from directory by reading file names from a text file
I want a script that is able to read the content of a text file which contains folder names and moves the folders from their directory to a specific folder. Here is my script: This script is partly working as it copies only the last folder in the text file, as for the other folders it gives the error “not
for loop syntax with grep in bash
I want to do text processing for lines in file.txt that ends with 0, I wrote an easy form of it to ask my question clearly. I want the output to be: 1 343 4352 0 432 432 2345 0 I want $i variable to be “1 343 4352 0” and after that to be “432 432 2345 0” but