![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| split varibles and store fields into shell varible array | gratus | Shell Programming and Scripting | 3 | 10-11-2007 02:50 PM |
| Grep results to store in a shell variable | jojan | Shell Programming and Scripting | 3 | 07-26-2007 12:44 PM |
| passing result of query to a varibale in ksh script | ammu | Shell Programming and Scripting | 2 | 07-27-2006 01:05 AM |
| When can a script deny to store any value in a variable | mitte_dino | Shell Programming and Scripting | 1 | 10-04-2005 06:57 AM |
| how do I store the values in array using shell | krishna | UNIX for Advanced & Expert Users | 2 | 08-17-2001 09:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
![]() Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable. like #!/bin/ksh v_shell_var[0]=Hi here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array). Regards, Div |
|
||||
|
Just in Below code I have change array box with [] and add new code for print the array member. #!/usr/bin/ksh let i=0 #set -A arr echo "select param_value from control_param where pgm_name = 'EXS_PROCESS'; exit " | sqlplus -s ${ora_user}/${ora_passwd}@${ORACLE_SID} | \ while read line do if [[ $i -gt 2 ]] then arr[$i-3]="$line" fi let i=$i+1 done echo "Array Variable is Filled Up" i=0 echo " Total no. of member ${#arr[@]} " echo "Print the Array member" while [ $i -lt ${#arr[@]}-1 ] do print ${arr[$i]} (( i=i+1 )) done echo "After Array Print" |
|
||||
|
Here, Situation is I have arr[] array. suppse
arr[0]=OWCD arr[1]=SPCS contains I want to if this pattern(arr[0] or arr[1]) match in ../Innovation dir's file then this file copy --> zip format --> into ../zipdir dir. If pattern is not found then copy into ../archive dir area I have tried below code...but not running. I feel , step 6/7 might be modified but how...please help me. 1. i=0 2. for j in `ls ../Innovation` 3. do 4. while [ $i -lt ${#arr[@]}-1 ] 5. do 6. # awk /${arr[$i]}/ { `cp $j ../archive`; } $j 7. source_dir=$($j | head -1 | grep -i ${arr[$i]} | cp ../Innovation/$j ../archive) 8. done 9.done |
|
||||
|
Processing Command line Parameteres in to array
I need to get files names passed to a script. Here number of files passed may vary
like MyScript.ksh file1 file2 file3..... so on I am writting script somthing like this set -A Files while (i<=$#) do File[i]=$i let i=i+1 done Is this correct way doing this. Is there any other way. Please let me know Thanks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|