Skip to content

Help: a variable list filtering via sed + "blacklist-variable" #59

@blackcrack

Description

@blackcrack

dirlist=$(ls /home) =>

dirlist="blackcrack akira lost&found workshop garage office"
blacklist="lost&found garage workshop"

the way to the result
echo $result
blackcrack akira office

how become from the $dirlist i a filtering with the 3 words in the $blacklist
to a result with the rest of the words..

i have try it via oneliner :

[blackcrack@blackysgate ~/bearbeit-net]$ dirlist=$(ls /home) ; blacklist="lost&found garage workshop" ; echo $dirlist | sed 's/$blacklist//'
blackcrack akira lost&found workshop garage office
[blackcrack@blackysgate ~/bearbeit-net]$

but it works not really simply with sed.. mus i use there a loop or something over "while"

best

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions