Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

array item bash

ARRAY=( "engineer " "CEO" "doctor" "teacher" )

for i in "${!ARRAY[@]}"
do
      echo " index---------------content"
      echo " $i                  ${ARRAY[$i]}"
done
Comment

bash arrays

#!/bin/bash

a=()
b=("reason" "logic" "aspect" "ethic")
echo ${b[2]}
Comment

array item bash

#!/bin/bash
AR=([3]='foo' [5]='bar' [25]='baz' [7]='bat')
for i in "${!AR[@]}"; do
  printf '${AR[%s]}=%s
' "$i" "${AR[i]}"
done
Comment

bash array

ss="abcdefghi"
my_array=( `echo $ss | grep -o . ` ) # split word into array

echo ${my_array[2]} 
give c

i=0
echo ${my_array[$i]}${my_array[$i+1]}xxx
give : abxxx
Comment

PREVIOUS NEXT
Code Example
Shell :: gitignore all files and folders in only one folder 
Shell :: helm release minio 
Shell :: how to add remote branch 
Shell :: how to put a youtube video in github description 
Shell :: install bootstrap vue 
Shell :: wc bash 
Shell :: set environment variable linux 
Shell :: add branch to bash-prompt 
Shell :: git use cat instead of less 
Shell :: wp cli tagline 
Shell :: linux make symlink 
Shell :: install spark 2.4.0 on ubuntu 
Shell :: how to make top bar transparent ubuntu 
Shell :: letencrpt 
Shell :: how to kickstart ARD on mac using terminal 
Shell :: print screen in ubuntu to folder 
Shell :: cherry pick from another repository 
Shell :: Brave on OpenSUSE 
Shell :: git tag from commit 
Shell :: npm install bootstrap 3 angular 
Shell :: how to check gems installed 
Shell :: how to connect to a git repo in cmd 
Shell :: how to see what files are committed in git 
Shell :: tasksel uninstall package 
Shell :: for while bash 
Shell :: composer reinstall all packages 
Shell :: remove branch not published yet 
Shell :: use output of pipe xargs 
Shell :: bash how to print the list of files in a directory ls 
Shell :: github undo last pushed commit 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =