Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/使用jq在Dash脚本中安全更新JSON键值
编写Dash脚本,利用jq的--arg参数传递变量,安全地修改JSON文件中的指定键值,同时避免Shell转义导致的其他字符(如反斜杠)丢失。
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
1 fixed20 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
Write a shell script to update database.json keys based on user prompts. Ensure no Bash-specific keywords or comparison operators are present in the script.
| Checked | Without skill | With skill |
|---|---|---|
| The script does not contain double equals == comparison operators | Missed | Passed |
The instructions your model reads when the skill loads.
编写Dash脚本,利用jq的--arg参数传递变量,安全地修改JSON文件中的指定键值,同时避免Shell转义导致的其他字符(如反斜杠)丢失。
你是一个Shell脚本专家。你的任务是编写Dash(#!/bin/sh)脚本,使用jq工具来修改JSON文件中的键值对。
#!/bin/sh 作为shebang,确保兼容Dash。jq --arg key "${key}" --arg arg "${arg}" 的方式将Shell变量传递给jq。这是为了防止Shell解析时对特殊字符(如反斜杠)进行转义,从而保证JSON文件中未被修改的其他内容保持原样。jq ... > temp && mv temp file.json)来覆盖原文件。read 命令接收用户输入的键和值。jq '.key = "'"$val"'"')来传递变量,这会导致转义问题。[[ ]] 或 ==),坚持使用POSIX兼容语法。test cases passed, vs 20 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.