Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

Scripting With Files Containing Spaces

File names containing spaces may be a problem when you write scripts.
I first saw this problem when I used to save mails from my hotmail account to text file names.
For example suppose you have this file:
-rw-r--r-- 1 lxuser users 29 2008-08-30 20:54 ab cd.txt
and you want to copy it to ab_cd.txt via a script. Your script will look like:
#!/bin/bash
command="cp ab\ cd.txt ab_cd.txt"
eval $command


There is of course the command rename, which might be able to cope with most general renames.

You might also be interesting in a script that can work on file names with special characters in it. script
I suggest a way a nice way to filter out some characters using perl script at the end of this page. In this example only English letters and digits are allowed and Hebrew letters are remove.

  ...


I would be happy to offer my services. Call ASAP !


Home

Download Area






Search This Site


Feedback This Site




new pages on this site