Skip to content

Add literal from content of a file with newline #713

Answered by mikefarah
saadlu asked this question in Q&A
Discussion options

You must be logged in to vote
content=$(cat file.txt) yq e -n '.a = strenv(content)'

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@saadlu
Comment options

Answer selected by saadlu
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants