cli
cli copied to clipboard
Item not found when scripting
I wrote this simple script:
#!/usr/bin/env bash
# options and params {{{
while [ -n "$1" ]; do
case "$1" in
--search)
query="$2"
shift
;;
--session)
session="$2"
shift
;;
*) echo "option $1 not recognized";;
esac
shift
done
# }}}
# main {{{
items_ids=`bw list items --search $query --session $session | jq '.[] | .id'`
for id in $items_ids
do
echo "bw delete item $id --session $session"
bw delete item $id --session $session
done
# }}}
The delete command outputs Not found. but when I copy-paste the echoed command, it works just fine.
I have no idea why.
Hi AdrienGiboire, We're cleaning up our repositories in preparation for a major reorganization. Issues from last year will be marked as stale and closed after two weeks. If you still need help, comment to let us know and we'll look into it. Thanks!