My script takes a list of files as arguments. I want to add a new argument to an array $@. For a regular array named there fileswill be an addition to the array files+=(name_here.png). How to make to add to $@?
$@
files
files+=(name_here.png)
I would call @ hek2mgl answer the best answer for a specific array, but if your goal is to explicitly expand $@ , then go to the following:
set -- "$@" '/path/to/file1' '/path/to/file2'
I would copy $@to an array and add to this:
files=( "${@}" ) files+=( name_here.png )
Then use ${files}in the script, not ${@}.
${files}
${@}
Source: https://habr.com/ru/post/1688623/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1688618/tensorflow-fails-to-compile&usg=ALkJrhhKzXBuwdLi1LBtl6WFsOtYiWDVjwCan I determine which label forwarding overload is used at compile time? - c ++Proximity Maps Using R - rcreate PriorityQueue in O (n) using custom comparator - javaForce R include 0 as the value in the regression of samples versus year - rASP.NET Core works with two test servers to test integration - c #CSS brick layout - javascriptAspNetCore.TestHost инъекции зависимостей в контроллер возвращает 500 ошибок - c#Initializing a new GHCJS project using the Haskell toolkit - haskellCan I apply one annotation to several targets in Kotlin? - annotationsAll Articles