Search Results

Search: Posts Made By: gavin_L
1,300
Posted By elixir_sinari
echo $line|read -A array or set -A array...
echo $line|read -A array
or
set -A array $line
or
array=($line)
5,859
Posted By elixir_sinari
Remove the 4 and check for yourself.
Remove the 4 and check for yourself.
2,542
Posted By pamu
try this.. assuming you have already have...
try this..
assuming you have already have functions for add,delete ans so on..

input file

$cat file
add data1 data2
delete data1 data2
replace data1 ...
2,542
Posted By Klashxx
You need eval here: # cat test.sh ...
You need eval here:
# cat test.sh
#!/usr/bin/ksh

add ()
{
echo "Add: param $1"
}

delete ()
{
echo "Delete: param $1"
}

func=add
param=test
eval $func \$param

func=delete...
3,678
Posted By Lem
Try starting from here: #!/bin/ksh while read...
Try starting from here:
#!/bin/ksh
while read line; do
read -A array <<<$line
n=${#array[@]}
echo "${array[0]} is my function"
for ((i=1;i<$n;i++)); do
print "${array[$i]} is datum"
...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 11:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy