About 380,000 results
Open links in new tab
  1. How to Print an Array in Bash? [5 Cases] - LinuxSimply

    Apr 23, 2024 · You can use the following 5 methods to print an array in Bash: To print the entire array: ${your_array[@ or *]} To print the array index, value, and type: declare -p <your_array> …

  2. Array Basics in Shell Scripting | Set 1 | GeeksforGeeks

    Apr 8, 2024 · In this article we discussed about utility of arrays in shell scripting. It underlines how arrays efficiently handle a multitude of values, replacing numerous variables. The concept of …

  3. Print array elements on separate lines in Bash? - Stack Overflow

    Feb 4, 2017 · How do I print the array element of a Bash array on separate lines? This one works, but surely there is a better way: $ my_array=(one two three) $ for i in ${my_array[@]}; do echo …

  4. How to Print Array in Bash Shell Script - CyberITHub

    Aug 27, 2019 · Here we will look at the different ways to print array in bash script. You need to have a running Linux system with root access to provide execute permission on all the scripts …

  5. How to Use Arrays in Bash Shell Scripts - Linux Handbook

    Learn to use arrays in bash shell scripts. Learn to print arrays, and know how to add or remove elements from arrays and get the size of array.

  6. Bash Print Array: A Quick Guide to Displaying Elements

    This comprehensive guide covers the essentials of bash print array functionality—from understanding different types of arrays to efficiently printing their content. Armed with this …

  7. How to use bash array in a shell script - LinuxConfig

    Print the values of an array. To display all the values of an array we can use the following shell expansion syntax: $ echo ${my_array[@]} Or even: $ echo ${my_array[*]} Both syntax let us …

  8. Shell Scripting 101: Arrays in Shell Scripts - LinuxForDevices

    Mar 3, 2020 · You can print all the elements of an array in a shell script using the syntax echo ${my_array[@]}. This will display all the elements contained in the array.

  9. shell - sh + how to use array in sh script in order to print all …

    To initialize an array element in a ksh-like shell, you must use syntax array[index]=value. To get all element in array, use ${array[*]} or ${array[@]} . Try:

  10. Shell Scripting: Arrays - Medium

    Jun 12, 2023 · In shell scripting, an array is represented by parentheses () and elements are arranged with spaces in between them. There are no commas. We can access our array and …

  11. Some results have been removed
Refresh