cli icon indicating copy to clipboard operation
cli copied to clipboard

Item not found when scripting

Open whoshallsucceed opened this issue 7 years ago • 1 comments

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.

whoshallsucceed avatar Nov 01 '19 22:11 whoshallsucceed

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!

bitwarden-bot avatar Apr 12 '22 19:04 bitwarden-bot