LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-21-2007, 09:24 AM   #1
SethsdadtheLinuxer
Member
 
Registered: Jun 2007
Posts: 152

Rep: Reputation: 37
Garbage Manhandler


Greetings fellow linuxers. I'm working on a script to move files from a Windows box onto a Linux server. I'm doing this in 4 steps.
Step 1 uses the Samba Client to get a directory of the Windows Share.
Step 2 copies the files one at a time using get or mget depending on the name type (short or long)
Step 3 removes the file from the Windows share.
Step 4 move the file from /tmp to the desired target

The problem I'm having is when the user "goes nuts" using the "long file" name in Windows. Mget lets me "wildcard copy" the file over. del works on the mget name. Here's the copy of a file that makes /bin/mv fail:
mv 'killprogram\!$_&____#$.logI#($#$~@!#!@#(!(%$#%$#%$%\'#($#($#$#&$#@${.xls' test

Returned message:
mv: line 1: unexpected EOF while looking for matching `"'
mv: line 2: syntax error: unexpected end of file

google hasn't really been helpful in solving this one


*** Here's the answer I found ***
Got the Inode of the file using perl -stat function

did this command
find / -inum #### -exec mv {} test \;

This moves the file using inode from where you found it to where you want it.

Last edited by SethsdadtheLinuxer; 06-21-2007 at 12:29 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2Wire Garbage axessterminated Linux - Hardware 3 10-07-2005 11:47 AM
what does garbage collected mean Garda Programming 3 08-25-2005 01:54 AM
Video garbage only zonder Linux - Newbie 5 07-21-2005 03:37 PM
Printing garbage sakkie Slackware 1 09-19-2003 12:14 PM
xv grab garbage kramtoad Linux - Software 0 08-23-2003 07:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration