Knife bootstrap is complaining: Could not parse the provided JSON file (/etc/chef/first-boot.json): lexical error: inside a string, '\' occurs before a character which it may not


#1

Hello,

Can anyone help me to fix this problem for the below knife bootstrap to allow backslash character i.e '" .

Could not parse the provided JSON file (/etc/chef/first-boot.json): lexical error: inside a string, ‘’ occurs before a character which it may not.

           'Admini\strator_raja' 

(right here) ------^

Thanks and Regards,
Rajan


#2

The \ character is the Escape character in JSON so you’d need \\.


#3

Thanks for your reply then i think , i have to replace the \ from user input string with \ . can you please suggest, what is the best way to replace through json attributes.