ITEM: U8611L

How can I 'mv' a file whose name is unprintable?


ENV:
.3.2.5
.DESC:
.My boss created an important file from her home system but something
went wrong when she named it so that is consists of only unprintable
characters.  She would like to rename it to something usable.  Is there
a way to get 'mv' or 'cp' to prompt with the old name and ask for the 
new name?  Is there a standard way to deal with this?
.ACTION:
.One solution is to use awk to isolate the file name. 
.You MUST have at least one piece of unique information
about the file.  The time stamp and/or file size usally
suffice.  In this example I used both.
.\# ls -l 
    -rw-r--r---1 root  system   880 May 18 17:09 junkfile
.\#  mv `ls -l |grep 17:09 |grep 880 |awk '{print $NF}'` newfile
.\# ls -l 
    -rw-r--r---1 root  system   880 May 18 17:12 newfile
.NOTE: awk uses single quotes (') around the braces and 
everything between mv and newfile is in backtics(`)


Support Line: How can I 'mv' a file whose name is unprintable? ITEM: U8611L
Dated: May 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:35
Comments or suggestions? Contact us