1

I am having an issue with for loop on centos:

I am trying to convert a lot of .pst files using readpst library:

the following works fine:

/bin/readpst -o /destination_directory -M -S -e -D /source_location/sample.pst

however when I try to run:

for i in 'cat list_all_psts.txt'; do /bin/readpst -M -S -e -D /source_location/sample.pst -o /destination_directory; done 

I get error opening File.

so I tried to add "sleep 30":

for i in 'cat list_all_psts.txt'; do /bin/readpst -M -S -e -D /source_location/sample.pst -o /destination_directory; sleep 30; done

with no avail. Does anyone have an idea what is wrong with this syntax? Any help would be much appreciated

Regards, R

kabanus
  • 24,623
  • 6
  • 41
  • 74
  • 2
    try while loop like `while read line;do echo $line ;done < list_all_psts.txt` – monk Dec 26 '18 at 18:55
  • 2
    also wondering where have you used `i` inside for loop – monk Dec 26 '18 at 18:59
  • Hi - thank you for your comment. I did add $i instead of /source_location/sampe.pst so you suggest to use the while loop instead? – Robert Wojciechowski Dec 26 '18 at 19:13
  • Hi there, Many many thanks for help!!! :) - you saved me a lot of time. 'while read line; do /bin/readpst -M -S -e -D /source_location/$line -o /destination_directory ;done < list_all_psts.txt' have a good day/evening/night – Robert Wojciechowski Dec 26 '18 at 19:28

0 Answers0