Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)RE
Posts
0
Comments
3
Joined
1 mo. ago

  • Do this instead to treat name as a locally scoped variable:

     
        
    foo() {
        local name="$1"
        read -r -p "delete $name (default is no) [y/n]? " choice
        choice="${choice:-n}"
        echo "\$choice: $choice"
    }
    
    printf "%s\n" "foo" "bar" "baz" "eggs" "spam" | while read -r name; do
        foo "$name"
    done