Fix OS examples annotated by Yitao

This commit is contained in:
Timothyxxx
2024-01-25 19:57:32 +08:00
parent 0c34fccc15
commit b9ae4174b1
24 changed files with 327 additions and 358 deletions

View File

@@ -1,13 +1,21 @@
{
"id": "7688b85f-87a4-4e4a-b2f8-f3d6c3f29b82",
"snapshot": "os",
"instruction": "Can you move the file with the path '/test.txt' to the directory with the path '/dir1'?",
"instruction": "Can you move the file with the path 'todo.txt' to the directory with the path 'done'?",
"source": "https://ubuntu.com/tutorials/command-line-for-beginners#5-moving-and-manipulating-files",
"config": [
{
"type": "execute",
"parameters": {
"command": "touch /test.txt && mkdir /dir1"
"command": "echo 'password' | sudo -S touch ~/Desktop/todo.txt && sudo mkdir ~/Desktop/done",
"shell": true
}
},
{
"type": "execute",
"parameters": {
"command": "echo 'password' | sudo -S chmod 777 ~/Desktop/todo.txt && sudo chmod 777 ~/Desktop/done",
"shell": true
}
}
],
@@ -19,14 +27,13 @@
"func": "exact_match",
"result": {
"type": "vm_command_line",
"config": {
"command": "if [ -f '/dir/test.txt' ]; then echo 'File exists.'; else echo 'File does not exist.'; fi"
}
"command": "if [ -f ~/Desktop/done/todo.txt ]; then echo 'File exists.'; else echo 'File does not exist.'; fi",
"shell": true
},
"expected": {
"type": "rule",
"rules":{
"expected": "File exists."
"expected": "File exists.\n"
}
}
}