The UNIX and Linux Forums  
Hello and Welcome from to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Question on Regular Expression Katkota UNIX for Dummies Questions & Answers 14 05-18-2008 06:11 PM
Regular Expression question Katkota UNIX for Dummies Questions & Answers 6 05-14-2008 04:23 PM
Variable regular expresion in awk. Klashxx Shell Programming and Scripting 4 08-31-2006 03:17 AM
Regular Expression Question Krispy UNIX for Dummies Questions & Answers 3 01-20-2006 10:36 AM
question about regular expression brentdeback Shell Programming and Scripting 0 11-14-2005 04:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-13-2004
gillbates gillbates is offline
Registered User
  
 

Join Date: Mar 2002
Location: DC
Posts: 46
regular expresion question

I receive windows files via the internet on my solaris server. Since unix doesn't handle blanks well I change the blanks to ? which works just fine. I take these files and ftp them to windows so our analysts can work with them. Recently I received a file with the following structure:

/xxxxx/xxxxx/xxxxx/name_fn_894983489 #2 name2.csv

my shell converted that to:

/xxxxx/xxxxx/xxxxx/name_fn_894983489?#2?name2.csv

and my ftp failed. Actually it didn't but the way I get the file from the server it comes in on to the server my shell is running on is:

rsh cat file.name > localfile

and the cat failed. However when I tried to cat or ls it on the server it resided on it worked. But when I tried to cat or ls it with a rsh it couldn't find the file. That # sign looked questionable so I looked into it and it looks like I'm probably telling it to suppress two bytes of the name.

So my question is does the rsh cause the # sign to resolve whereas if I'm on the server it won't? Does anyone know how this works?
  #2 (permalink)  
Old 09-13-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
I think having the "#" character there is dodgy because the shell is probably treating the end of the filename as a comment.

I'd also advise against using a "?" as a "regular" character, seeing as it's a shell wildcard - that will end up causing problems somewhere down the line too. Use an underscore instead.

Cheers
ZB
  #3 (permalink)  
Old 09-13-2004
gillbates gillbates is offline
Registered User
  
 

Join Date: Mar 2002
Location: DC
Posts: 46
By using the ? mark there I can get away with having spaces in a name as the system looks for anything there. I don't actually rename the files.
  #4 (permalink)  
Old 09-13-2004
encrypted's Avatar
encrypted encrypted is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2004
Location: Oslo, Norway
Posts: 219
Quote:
I receive windows files via the internet on my solaris server. Since unix doesn't handle blanks well I change the blanks to ? which works just fine. I take these files and ftp them to windows so our analysts can work with them.
FYI Windoze does not understand ? or any special characters
in the names of a file. In case you are putting a ? in the name of a file and FTP it you can (as JazzyBob suggested) place an underscore in the name of the file as against a ?

Cheers
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0