veryangryman wrote: » I have an optional argument for a script (a filter) but i want the option to have no filter So the command is grep $filter file I want that filter to sometimes be the empty string i.e everything if the user so wishes but grep '' does not do it
grep "$filter" file
L.Jenkins wrote: » ...would using grep to filter an empty string simply seek out and remove all white space within a file or a returned output of a command
#!/bin/bash filter=$1 grep "$filter" ~/adapter.log exit 1
L.Jenkins wrote: » Maybe I'm having an off day today, but would using grep to filter an empty string simply seek out and remove all white space within a file or a returned output of a command? As I said, I might be having an off day in thinking this way today.