|
1
2
3
4
5
6
|
[root@bogon ~]
# python tt.py
server1
server2
[root@bogon ~]
# bash a.sh
server01
server02
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
[root@bogon ~]
# cat a.sh
#!/bin/bash
server=
"server01 server02"
for
i
in
${server}
do
echo
${i}
done
[root@bogon ~]
# cat tt.py
#!/usr/bin/env pyhton
#encoding:utf-8
def
do
():
arry = [
"server1"
,
"server2"
]
for
i
in
arry:
print(i)
if
__name__ ==
"__main__"
:
do
()
[root@bogon ~]
#
|
本文转自 小小三郎1 51CTO博客,原文链接:http://blog.51cto.com/wsxxsl/1953603,如需转载请自行联系原作者