Thursday, 22 July 2021

Add a new element to an array without specifying the index in Bash

ARRAY=()
ARRAY+=('foo')
ARRAY+=('bar')


from: https://stackoverflow.com/questions/1951506/add-a-new-element-to-an-array-without-specifying-the-index-in-bash

No comments:

Post a Comment

How to check if a file contains a specific string using Bash

 In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...