Ric_ Posted April 20, 2007 Posted April 20, 2007 OK... the wonderful PyKota box is running pretty smoothly now and I'm looking ahead to charging the departments. To do this, I thought that I would use pkinvoice to generate invoices for each staff user. The staff users can be distinguished by the first character of the username being a letter rather than a number. My idea was to export the users to a file which I could then read a line at a time and run the pkinvoice command for the username on each line. My problem is that I'm unsure how to read files in a bash script :oops:
Geoff Posted April 20, 2007 Posted April 20, 2007 http://tldp.org/LDP/abs/html/index.html Part 5 Section 19 and Appendix E seem relevant.
Ric_ Posted April 20, 2007 Author Posted April 20, 2007 @Geoff: That is where I have been looking... I cannot seem to figure out a way of reading one line at a time though.
Ric_ Posted April 20, 2007 Author Posted April 20, 2007 @Geoff: Enlighten me to the syntax that I desire then
mac_shinobi Posted April 20, 2007 Posted April 20, 2007 use a loop and in the do sectoin just get it to read the one line at a time and then go to the next line after reading it and make it do it until the end of the file http://tldp.org/LDP/abs/html/loops1.html
Geoff Posted April 20, 2007 Posted April 20, 2007 I'm going to cheat and use awk (disclaimer: untested).. cat userlist | awk {print $0 | pkinvoice}
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now