Я хотел бы записать переменную в файл JSON.
Я перепробовал много команд sed, но все еще не могу найти решение
#! bin/bash
echo "Hello"
echo "lets create an instance"
read -p "please enter the type of instance you need: " instance_type
echo $instance_type | sed -i "s|""InstanceType"": """"|""InstanceType"":
""${instance_type}""|g" awsspotinstancecreation.json
roxor@ubuntu:~$ bash rough.sh
Hello
lets create an instance
please enter the type of instance you need: t2.small
{
"ImageId": "ami-074acc26872f26463",
"KeyName": "Accesskeypair",
"SecurityGroupIds": ["sg-064caf9c470e4e8e6"],
**##"InstanceType": "${instance_type}",##**
"Placement": {
"AvailabilityZone": "us-east-1a"
}
}