Back to Newsletters KEYWORDS=spaces, filenames, wc, wyse, terminals, DAVROM CONSULTING Newsletter - Issue # 30 - Dated: Tue Dec 20 09:53:01 EST 2005 From the desk of David Clark As the year draws to a close and Christmas is here, I would like to thank all our customers, suppliers and readers of the DAVROM Newsletter for your continued support. Without you all, DAVROM would not exist. We are here over the Christmas/New Years break except for the standard public holidays so our support doors/channels are open if you need us. ######################################### ## \ / ## ## ## ## * ## ## $ ## ## /o\ ## ## /\ *\ ## ## /o*/o/\ ## ## /*/\ *\o\ ## ## /\o*\/o\/*\ ## ## /\/*/o\ /*\o\ ## ## /*/\/\ /*o/\/*\ ## ## o o # o o ## ## # ## ## __#__ __%__ ## ## \_____/ |_____| ## ## ## ## / Merry Christmas From DAVROM \ ## ######################################### I would like to thank the reader for their time in reading this newsletter. David.M.Clark UNIX Quote The UNIX legacy is a set of simple and timeless tools that can take years to master but which can perform seeming miracles in the hands of experienced users. -- a Bellevue Linux Users Group member, 2005 Spaces in file names With the increased use of UNIX/Linux servers as file and print servers over the years I have found some slight hick-ups when doing UNIX/Linux command line based file manipulation of the files created by MS applications. The hick-up is to do with using blank spaces (produced by your keyboard space key) in file names - and for that matter, directory names. Traditionally from the UNIX perspective and even from the days of MSDOS (or CP/M if you remember back that far), spaces have always been used as the command line IFS (internal field seperator) - so why change? When using commands like "mv", "cp" and "ls" you can use the "\", "*" and quote characters to get around command line file manipulation on file names that have spaces, or if you are using the bash shell you can just use the tab key to use file name completion - and on some versions of UNIX the ksh will do the same file name completion with the Escape key. But rather than have to go through the many tricks to get around this, I have always tried to use the "_" character when creating new files - call it a discipline if you like. So an example file name called: 2005 my budget.xls becomes 2005_my_budget.xls Viva the non-space character file names. EMO version 1.1 We have recently released version 1.1 of our EMO product (Electronic Mail Organiser) and have started to roll it out to existing owners of the 1.0 version free of charge. We have added some slight enhancements based on customer feedback (oh the mighty wish list) and implemented PHP in place of CGI script. You can view a demo of the product at: http://www.davrom.com/emodemo Wyse Terminals We have recently brought in 10-12 Wyse 60 terminals and I still have to go through them all to see which ones are still working - so if you are interested in obtaining any, please let us know. Given the age of the terminals no warranty can be offered but at least they should work for some time to come given the legacy reliability - you'd be amazed where I have seen dumb terminals deployed. If you have any old Wyse terminals around the place, please let us know as we tend to still get enquiries for them. Tech Tip You sometimes need to know how many files are in a directory for various reasons so here are some quick command line examples of doing calcs regarding directory files contents. ls -l /tmp | wc -l This will return the number of lines in the /tmp directory. This will equate to the number of files and/or directories in the /tmp directory. You must deduct 1 off the final figure as ls will also include the "total" in its header if it finds files there. NUMFILES=`ls -l /tmp | wc -l` echo $NUMFILES This takes the value of the "wc -l" and puts it into a variable called NUMFILES. Remember that if NUMFILES has a value of 1, then there are no files or directories under /tmp. ls -l /tmp/s* | wc -l This will show you the number of files that start with the letter "s" - you do not need to allow for the "total" when output when specifying set wildcard ("*") patterns as it is not displayed. Back to Newsletters Website design by Davrom Consulting Pty Ltd This site is fully tested with Google Chrome and Firefox web bowsers Home Page | Support | Misc | David's Pages | Podcasts | Contact Us | Blog |