Hi all,
I write a script in ksh like this 1:
#!/bin/ksh
folder=" /ebsxe/ebs25/users/mmlim/assignment01/dir01 "
cd $folderwhile read file
doset $(echo ${file})
cd $1
var=`ls -1 | wc -l`
if [[ $var -lt $2 || $var -eq $2 ]]; then
echo " $3"
else
echo " $3 "
fidone <config.txt
the output is :
group1
group2Then from that script i want read my another file :
file2:
group1 email1
group2 email2After it read and loop it the output should be this :
email1
email2How i going to done it?
One way is to use the shell to parse the line. Since your file2 has 2 columns: # Untested while read groupvar emailvar do echo "$emailvar" done < file2I can comment on your other script if you want. For example, instead of testing for less than or equal this way:
if [[ $var -lt $2 || $var -eq $2 ]]; then
combine the two:
if [[ $var -le $2 ]]; then
Let me know if you want me to comment further on your original script.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |