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 :: run sh not a command mac 
Shell :: kubernetes force delete command 
Shell :: git create branch and checkout one command 
Shell :: delete a branch in git command 
Shell :: get container config docker 
Shell :: how to kill process in linux 
Shell :: kali metapackages detail 
Shell :: gatsby-plugin-typography 
Shell :: logitech g hub not installing windows 10 
Shell :: zsh shell in linux 
Shell :: disable snap 
Shell :: regex last word in lin 
Shell :: how to erase router configuration in cisco packet tracer 
Shell :: nano show line numbers 
Shell :: shutdown shortcut ubuntu 
Shell :: pip install six 
Shell :: rmdir unix 
Shell :: ubuntu path of saving screenshots 
Shell :: Add a Remote Repository in git command 
Shell :: install node_modules folder 
Shell :: touch command in windows 
Shell :: pdf compressor linux 
Shell :: How do I save terminal output to a file? 
Shell :: linux help 
Shell :: nvm github 
Shell :: dir /s cmd 
Shell :: rails db:rollback 
Shell :: kubernetes copy files to persistent volume 
Shell :: install sonarqube on ubuntu 
Shell :: how to enable tpm in bios 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =