Search Results

Search: Posts Made By: Muhammad Rahiz
4,243
Posted By Scott
Hi. Try using eval: $ cat MyTest a1=(...
Hi.

Try using eval:

$ cat MyTest
a1=( win 12,01,02,03,04 )
a2=( pre 04,05,06 )
a3=( msn 06,07,08,09 )

for i in {1..3}; do
eval echo \${a$i[0]}
eval echo \${a$i[1]}
done

$...
12,602
Posted By Scott
Hi. If that's all the data you have, try...
Hi.

If that's all the data you have, try using the paste (https://www.unix.com/man-page/OpenSolaris/1/paste/) command.


$ cat file1
Jan
Feb
Mar

$ cat file2
01
02
03

$ paste -d" "...
2,265
Posted By rdcwayx
#!/bin/ksh integer j=1 for i in jan feb mar...
#!/bin/ksh
integer j=1
for i in jan feb mar apr may jun jul aug sep oct nov dec
do
mon=$(printf "%02d" $j)
infile=$(ls afgcx* |grep $i)
mv $infile afgcxa.pem4-$mon.$i.rain.nc
j=j+1...
2,265
Posted By frank_rizzo
simple alternative to printf typeset -Z2 j=1
simple alternative to printf

typeset -Z2 j=1
2,265
Posted By malikshahid85
You can use the following script ...
You can use the following script


#!/bin/ksh
integer j=1
for i in jan feb mar apr
do
infile=`ls afgcx*|grep $i`
mv $infile afgcxa.pem4-0$j.$i.rain.nc
j=j+1
done
8,069
Posted By vistastar
1 #!/bin/bash 2 3 if [ $# -ne 3 ];then ...
1 #!/bin/bash
2
3 if [ $# -ne 3 ];then
4 echo "Usage: $0 num1 num2 dir"
5 exit 1
6 fi
7 ls -1 $3 |sed -n "$1,$2p"
8 exit 0
9


...
Showing results 1 to 6 of 6

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