how to add "SecureNote" type and preserve the newlines in the data

Options
PXG743
PXG743
Community Member

I am using: "op item create --template xyz.json --format json" command to upload a file that has three sections (id, label, value, ...). The create works however I am unable to use data (in the "value" attribute) that have newline (Linux "\n") in it. Can one of the SME(s) kindly provide guidance on how to resolve this issue? the newline is part of the data and without it MAC/Hash will fail. Thank you.
PS: I am running the tool in Linux, and accessing an enterprise version of 1Password (example: "acme-ent.1password.com").


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: RHEL 8.5
Referrer: forum-search:how to upload JSON template with newline

Comments

  • Hey @PXG743 , just to confirm my understanding, is it correct that your issue is the inability of op to parse the template file (i.e. to interpret the special characters)?

    If so, a workaround for this would be to pipe the file into the command, and to parse it manually, such as:

    (echo "cat<<EOF" ; cat item.json ; echo "EOF" ) | $SHELL | op item create
    

    Let me know if this serves your use-case. Looking forward to hearing from you!

    Best,
    Horia

This discussion has been closed.