I'm using sed
to obtain a specific string (0x0296cc83474725ddca19a9feefb3aec3602d9073688a4db6885695320cd2a738
) from an output. This string comes next to Contract address:
This is what I'm trying currently.
UPDATE: out put has newlines.
$ echo $output
Starknet plugin using the active environment.
Deploying contract.cairo/contract.json
Deploy transaction was sent.
Contract address: 0x0296cc83474725ddca19a9feefb3aec3602d9073688a4db6885695320cd2a738
Transaction hash: 0x3f60551591f6abb9c79044ce15de4260eb169af2931abdc279e73f6428fc12d
Succeeded
$ ADDRESS=$(echo $output | sed -r "s/.*Contract address: (\w*).*/\1/")
$ echo "Address: $ADDRESS" # This is not working
I know how to grab the contract addres using awk
but for this case I have to use sed
.