INNER CODE UNIT · Shell

filter

todotxt/todo.txt-cli · todo.sh:858

    filter=${1:-}
    shift
    post_filter=${1:-}
    shift

    for search_term
    do
        ## See if the first character of $search_term is a dash
        if [ "${search_term:0:1}" != '-' ]
        then
            ## First character isn't a dash: hide lines that don't match
            ## this $search_term
            printf -v filter '%sgrep -i %q' "${filter:-}${filter:+ | }" "$search_term"
        else
            # First character is a dash: hide lines that match this
            # $search_term
            #
            ## Remove the first character (-) before adding to our filter command

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…