首页 > 解决方案 > shell脚本是否有类似类型的python列表

问题描述

shell脚本是否有类似类型的python列表,

用于检查列表中的项目的 Python 脚本:

  list = ["one", "two", "three", "four"]

  if "one" in list:
      print "Yes, one item found in list"
  else:
      print "No, one item not found in list"

在 Shell 脚本中:

list="一二三四" 如何检查 shell 脚本中存在的“一”键

标签: pythonlinuxbashshell

解决方案


推荐阅读