The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
simple check to see if a folder exists psyman Shell Programming and Scripting 4 09-27-2007 02:15 PM
check if exists a .ZIP file and unzip it using ftp DebianJ Shell Programming and Scripting 1 05-05-2005 05:46 PM
Check Remote Folder Exists borncrazy Shell Programming and Scripting 1 07-12-2004 05:15 PM
mounting a directory to a windows 2000 shared folder cw1972 Windows & DOS: Issues & Discussions 2 10-01-2003 04:48 AM
perl ftp check file exists methos Shell Programming and Scripting 2 06-18-2003 09:21 AM

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 05-08-2008
jul jul is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 4
check if file exists in a mounted windows shared folder

hi,

I posted a thread before on that subject, but with a wrong focus...

here's my problem: I want to check if a file exists in a windows shared folder mounted using:


Code:
sudo mount -t cifs -o username=xxx,password=xxx,uid=xxx,gid=xxx //192.168.0.92/public /media/92_shared

I tried


Code:
if [ -e "$file" ]

but it does a non case-sensitive check, probably because windows is not case-sensitive, while I need an exact match.

Any suggestion?

thanks

jul
  #2 (permalink)  
Old 05-13-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
If you need a case sensitive check on a filesystem that is not case sensitive, you'll have to do it outside of the shell's filesystem functions.
I'd suggest doing an ls -1 $file | grep $file
There's still room to get a false positive but you can refine your grep if needs be.
  #3 (permalink)  
Old 05-14-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377

Code:
ls -l | grep -w $file

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 10:52 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