'Only one type of list may be specified?
So I have a bash script which is below, and whenever I try to execute it, it says only one type of list may be specified, any clue as to whats wrong with this code? I interpret this as we use grep to find the word (-word) of the first character ($1) typed by the user in the file femalenames.txt and then using the cut command we print the 2nd field of characters 16-20? sort of confused there.
#!/bin/bash
grep -w $1 femalenames.txt | cut -f2 -c16-20
Solution 1:[1]
Just pipe it ( | ) again & it'll work.
Command guide here
#!/bin/bash
grep -w $1 femalenames.txt | cut -f2 | cut -c16-20
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Bonked |