I have recently upgraded from bash 4.2.46
to bash version 4.2.50
I had a script with the line:
mapfile -t my_array < <(grep ${ID} -w /etc/passwd | cut -d ":" -f 1,4,5)
where ID is an arbitrary integer we'd like to look for in the file passwd
and then load all results into an array.
that used to work but now throws an error
usage: grep [-r] [-R] [-H] [-L] [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] -e pattern_list...
[-f pattern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
can anyone explain how to work around this depreciation? I have attempted using sed
and awk
however the issue seems to be the format of my output redirection.
the text file passwd
looks like this
name:garbageData:garbageData:ID:password