Skip to content

Instantly share code, notes, and snippets.

View Dup4's full-sized avatar

Duplicate4 Dup4

View GitHub Profile
@Dup4
Dup4 / doc-table.md
Created May 25, 2022 05:21 — forked from antfu/doc-table.md
Doc Table in Markdown

Example

Name

Description


@Dup4
Dup4 / t.sh
Created October 16, 2020 03:25 — forked from likohank/t.sh
shell 判断某个元素是否在数组中,查看某个key是否存在
if [[ " ${array[@]} " =~ " ${value} " ]]; then
# whatever you want to do when arr contains value
fi
------------------------------------------------------
if [[ ! " ${array[@]} " =~ " ${value} " ]]; then
# whatever you want to do when arr doesn't contain value
fi
------------------------------------------------------
if [[ " ${!array[@]} " =~ " ${value} " ]]; then
# whatever you want to do when arr contains value