我有一个从网上下载的多行字符串:
toast the lemonade
blend with the lemonade
add one tablespoon of the lemonade
grill the spring onions
add the lemonade
add the raisins to the saucepan
rinse the horseradish sauce
Run Code Online (Sandbox Code Playgroud)
我已将其分配给$INPUT,如下所示:
toast the lemonade
blend with the lemonade
add one tablespoon of the lemonade
grill the spring onions
add the lemonade
add the raisins to the saucepan
rinse the horseradish sauce
Run Code Online (Sandbox Code Playgroud)
此时,$INPUT已准备好替换到我的目标文件中,如下所示:
INPUT=$(lynx --dump 'http://example.net/recipes' \
| python -m json.tool \
| awk '/steps/,/]/' \ …Run Code Online (Sandbox Code Playgroud) sed ×1