#!/bin/bash
#assignments
x=10
y=$x
echo "$x $y"
a=1.2
b=$a
echo "$a $b"
p="abc"
q=$p
echo "$p $q"
readonly n=100
s=$n
echo "$n $s"
#array to scalar
a=( 1 2 3 4 5 )
echo "${a[@]}"
m=${a[0]}
echo "a[0] $m"
arr=( "aa" "bb" "cc")
echo "${arr[@]}"
m=${arr[0]}
echo "arr[0] $m"
p=( "${arr[@]}" )
echo "p -> ${p[@]} "
v=100
a[2]=$v
echo "${a[@]}"
u="dd"
arr[1]=$u
echo "${arr[@]}"
#assignments
x=10
y=$x
echo "$x $y"
a=1.2
b=$a
echo "$a $b"
p="abc"
q=$p
echo "$p $q"
readonly n=100
s=$n
echo "$n $s"
#array to scalar
a=( 1 2 3 4 5 )
echo "${a[@]}"
m=${a[0]}
echo "a[0] $m"
arr=( "aa" "bb" "cc")
echo "${arr[@]}"
m=${arr[0]}
echo "arr[0] $m"
p=( "${arr[@]}" )
echo "p -> ${p[@]} "
v=100
a[2]=$v
echo "${a[@]}"
u="dd"
arr[1]=$u
echo "${arr[@]}"
No comments:
Post a Comment