是否有一个"设置"在bash数据结构? [英] Is there a "set" data structure in bash?

查看:78
本文介绍了是否有一个"设置"在bash数据结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python有它包含唯一对象定式。
确实击具有同等的东西吗?

Python has a "set" type which contains unique objects. Does Bash have something equivalent?

我要不断添加元素,这样的庆典设置永不重复的。

I want to keep adding elements to such a bash "set" and never have duplicates.

推荐答案

猛砸4.0具有关联数组,可用于构建集。

Bash 4.0 has associative arrays, which can be used to build sets.

下面是他们讨论的文章(这是第一款谷歌命中为bash的关联数组 )。

Here's an article that discusses them (it was the first Google hit for "bash associative arrays").

(就个人而言,我只是用比其他bash的东西,可能是Perl的。)

(Personally, I'd just use something other than bash, probably Perl.)

这篇关于是否有一个"设置"在bash数据结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆