Linked Questions

1001 votes
10 answers
2.2m views

I have the following .txt file: Marco Paolo Antonio I want to read it line-by-line, and for each line I want to assign a .txt line value to a variable. Supposing my variable is $name, the flow is: ...
Marco's user avatar
  • 10.9k
32 votes
5 answers
130k views

I have one file with a list of names. I need to loop through all names in this file from an external file with a shell script. How can I do that? Example files: scripts/names.txt alison barb charlie ...
Ryan's user avatar
  • 15.4k
4 votes
3 answers
110k views

Say for example I have a file called "tests",it contains a b c d I'm trying to read this file line by line and it should output a b c d I create a bash script called "read" and try to read this file ...
OKC's user avatar
  • 181
0 votes
1 answer
4k views

I have multiple filenames in files.txt. I want to run three scripts on each file. I my suggestion correct? files.txt: SRR13143.sra SRR44234.sra SRR23424.sra my try: for FILE in "file.txt"; do ...
user2300940's user avatar
  • 2,395
-1 votes
2 answers
2k views

Just need some help with a while read file from a specific column I have a file with a few columns and I want to use while loop for a specific column 123 50012 1111 235 40023 2222 674 30021 3333 ...
Max's user avatar
  • 27
0 votes
1 answer
3k views

I am writing a bash script that accepts a manifest.txt file. It should cycle through each row of that text file and call another script to pass the text string from the row of the text file after ...
Calvin's user avatar
  • 417
1 vote
1 answer
2k views

I am trying to grep a series of patterns that are, one per line, in a text file (list.txt), to find how many matches there are of each pattern in the target file (file1). The target file looks like ...
LP_640's user avatar
  • 579
0 votes
1 answer
1k views

I'm new in bash linux coding. Basically I would like to do a loop using a text file with two columns. For a single column file I use this type of code: for element in `cat /path/file.txt | tr -d '\r'` ...
Giordano's user avatar
-2 votes
3 answers
551 views

I have a one column text file (dates.txt) and I want to create a stack of directories named after the dates elements. How can I interpret it in bash?
Krsztr's user avatar
  • 101
0 votes
0 answers
1k views

I have a program that counts lines containing alphanumeric words. For example: this is line1 this is line 1234 this is line4 The answer is 2. count=0 while IFS= read -r line do if [[ $line =~ [[...
Divya Chauhan's user avatar
-1 votes
1 answer
318 views

I am trying to make a checkpoint management script, which will delete all checkpoints that are over 3 days old for a variety of databases. I want to keep the code in one script and then keep a list of ...
conor.ob's user avatar
1 vote
1 answer
268 views

Absolute beginner here. I have a list of passwords in a file named "pw.prn". Welcome99 ABCDEFGH 12545678 lakers2021 gododgers I wish to run each line in the file against a hashing program (...
T011AZ3's user avatar
  • 11
-1 votes
1 answer
420 views

I have numerous files in a directory and want to replace one of the libraries used in all of these files with a newer library because the old library no longer works. I have used ls > names.txt to ...
walkman118's user avatar
0 votes
1 answer
393 views

I have a for loop in my bash script. for dir in $directories do dockerfile=$(find ./repo/$dir -name "Dockerfile"); docker build -f $dockerfile . -t $dir:version; ...
villanelle's user avatar
0 votes
1 answer
300 views

I want to use an nmap script to convert ASN -> IP ranges So the nmap script is used like that, nmap --script targets-asn --script-args ragets-asn.asn=12345 This command return the IP ranges in ...
letok's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
9