General
cancel
Showing results for 
Search instead for 
Did you mean: 

deleting embedded file names under HP-UX

SOLVED
Go to solution
Paolo_c
Advisor

deleting embedded file names under HP-UX

Good morning, 

 

I 'm hoping that someone can assist me with the following issue.  I FTP'd some scripts from HP-UX onto a VMS server (in order to edit them using different editor to VI ). After I edited the files I then ftp'd back onto the HP-ux system (under an FTP sesssion intiiated trom the original HP-UX server _

 The files came across (but with the VMS directory names embeeded in the filenames !!!), which I hadn't allowed for !!  Could someone please advise me of the command  I  need to run in order to delete these files from the HP-UX server ?  (I'm assuming I could have avoided the issue below, by FTP'ing via windows back toi hp-ux system rather then ftp'ing them directly between the 2  servers ? 

 

# find . -mtime -1 

/SYSROOT:[SYSMGR]CHK_HEARTBEAT_PROD.SH;1
./SYS$SYSROOT:[SYSMGR]CHK_HEARTBEAT_NONPROD.SH;1

 

3 REPLIES
Steven Schweda
Honored Contributor
Solution

Re: deleting embedded file names under HP-UX

   The response in the VMS forum should be adequate:

      http://community.hpe.com/t5/x/x/m-p/6835412

   A Forum search for keywords like, say:
       file name special character
should find many related threads.

   As usual, showing the actual failing ("rm"?) command with the
resulting error message might have been helpful.

   I wonder how, exactly, you got FTP to give you those file names.
Commands like CD or LCD should be able to get you to the right
directory, and then simple names (without some weird, mixed-format
directory spec) should have been possible. Avoiding the VMS version
number (";1") may be harder, but is usually also possible.

> [...] (I'm assuming I could have avoided the issue below, had I copied
> the files indirectly between hp-ux to windows to VMS [...]

   Involving a third (Windows) system shouldn't be necessary, and it's
not clear that it would help. Again, showing exactly what you did to
get these results would make it easier to suggest what to do
differently. "I FTP'd some [files]" omits too many important details.

Paolo_c
Advisor

Re: deleting embedded file names under HP-UX

Many thanks for your reply.  As you suggested, the workaround provided on the VMS forum (substituting brackets, dots, semicolons with a * (star) provided the solution,.  I made the mistake of including the full VMS directory name in the FTp get filename specification (forgetting that HP-UX would include the directory in the filename that was copied over)

Steven Schweda
Honored Contributor

Re: deleting embedded file names under HP-UX

> [...] (substituting brackets, dots, semicolons with a * (star)
> provided the solution,. [...]

   _A_ solution, not _the_ solution. You can also use quotation or
backslash escapes to prevent the shell from interpreting the
shell-special characters. For example:

mba$ mkdir junk
mba$ cd junk
mba$ touch 'fr;ed'
mba$ ls
fr;ed
mba$ rm fr\;ed
mba$

and so on.

> I made the mistake of including the full VMS directory name in the FTp
> get filename specification (forgetting that HP-UX would include the
> directory in the filename that was copied over)

   As "man ftp" says:

      get remote-file [local-file]
            Copy remote-file to local-file. If local-file is unspecified,
            ftp uses the specified remote-file name as the local-file name,
            subject to alteration by the current case, ntrans, and nmap
            settings.

Thus, you can specify all kinds of horrible file specs for
"remote-file", so long as you also specify something nice (appropriate
for the local file system) for "local-file".