git@23373193:~/learnGit (master)$ echo first first git@23373193:~/learnGit (master)$ cd .. git@23373193:~ $ echo first first git@23373193:~ $ echo second > output git@23373193:~ $ echo third > output git@23373193:~ $ echo fourth >> output git@23373193:~ $ cat output third fourth
echoecho Shell Start... echoechoset a = 1 echo a=1 echoechoset b = 2 echo b=2 echoechoset c =a+b echo'c=$[$a+$b]' echoecho save c to ./filel echoecho'$c>file1' echoecho save b to ./file2 echoecho'$b>file2' echoecho save a to ./fille echoecho'$a>file3' echoecho save filel file2 files to file echocat'file1>file4' echocat'file2>>file4' echocat'file3>>file4' echoecho save file to ./result echocat'file4>>result'
随后执行:
1 2 3 4
chmod +x command ./command > test chmod +x test ./test > result
result文件内容:
1 2 3 4 5 6 7 8 9 10 11 12
Shell Start... set a = 1 set b = 2 set c =a+b save c to ./filel save b to ./file2 save a to ./fille save filel file2 files to file save file to ./result 3 2 1