i have a scenario

February 15, 2012 at 07:39:08
Specs: Windows XP

i need to write a code
i have some 3 files
file_kl1
file_kl2
file_kl3

i need to write an if condition to get the tables by pattern match and perfor some action
but i shoud get the same tables by removing the numbers 1, 2, 3


pls pls pls help me out very soon


See More: i have a scenario

Report •

#1
February 15, 2012 at 10:38:28
What kind of "if statement" do you have in mind??

#!/bin/ksh

# list out files starting with "file_kl" and one character
for i in file_kl?
do
   echo "$i"
done


Report •

#2
February 15, 2012 at 20:46:47
can i use pattern matching in if condition

Report •

#3
February 16, 2012 at 09:18:22
#!/bin/ksh

for i in *
do
   if [[ $i = file_kl? ]]
   then
      echo "file: $i matches pattern"
   fi
done


Report •
Related Solutions


Ask Question