#!/bin/sh for var in 0 1 2 3 4 do echo $var done
[vagrant@localhost tests]$ sed -i ‘s/\r//’ test.sh
[vagrant@localhost tests]$ ./test.sh
0
1
2
3
4
{0..5}とも書ける。」
#!/bin/sh for var in {0..5} do echo $var done
function
#!/bin/sh MyFunction(){ echo "display function" } MyParamFunc(){ echo "parm1:$1 param2:$2" } MyFunction MyParamFunc 5 4
[vagrant@localhost tests]$ sed -i ‘s/\r//’ test.sh
[vagrant@localhost tests]$ ./test.sh
display function
parm1:5 param2:4
with linux command
#!/bin/sh index=1 for file in *.txt do mv "$file" "mytxt${index}.txt" index=`expr $index + 1` done
[vagrant@localhost tests]$ sed -i ‘s/\r//’ test.sh
[vagrant@localhost tests]$ ./test.sh
すげええええええええええええええええええええええええ