Question for UNIX directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Question for UNIX directory
# 1  
Old 09-23-2013
Question for UNIX directory

hi all:

i am newbie here.

what is the difference between "/something-1/something-2" and "/something-1/something-2/"? they seem to the same but somehow there are something different. i have following scenario:

on one machine, it displayed error message with "/" at the end, but provided desired outcome with no "/" at the end:

Code:
% ls -al /var/db/scripts/import/
ls: /var/db/scripts/import/: No such file or directory
% ls -al /var/db/scripts/import
lrwxr-xr-x  1 root  wheel  27 Sep  8  2007 /var/db/scripts/import -> /usr/libexec/scripts/import

thanks!

Last edited by Scrutinizer; 09-23-2013 at 02:55 PM.. Reason: code tags
# 2  
Old 09-23-2013
/var/db/scripts/import here is a symbolic link to /usr/libexec/scripts/import. Can you show us what does this show:
Code:
ls -l /usr/libexec/scripts/import

# 3  
Old 09-23-2013
Quote:
Originally Posted by bartus11
/var/db/scripts/import here is a symbolic link to /usr/libexec/scripts/import. Can you show us what does this show:
Code:
ls -l /usr/libexec/scripts/import

thanks. actually the directory of /usr/libexec/scripts doesn't exist and i knew it doesn't exist. but i am wondering why it gave me error when i use "/" at the end.
# 4  
Old 09-23-2013
With the trailing slash, the pathname can only match a directory (there is none, therefore the diagnostic message). Without the trailing slash, the pathname is allowed to match any file type, including the existing symlink.

Regards,
Alister

---------- Post updated at 01:55 PM ---------- Previous update was at 01:28 PM ----------

POSIX Pathname Resolution (section 4.11):

Quote:
A pathname that contains at least one non-slash character and that ends with one or more trailing slashes shall be resolved as if a single dot character ( '.' ) were appended to the pathname.
Regards,
Alister
These 2 Users Gave Thanks to alister For This Post:
# 5  
Old 09-23-2013
Quote:
Originally Posted by alister
With the trailing slash, the pathname can only match a directory (there is none, therefore the diagnostic message). Without the trailing slash, the pathname is allowed to match any file type, including the existing symlink.

Regards,
Alister

---------- Post updated at 01:55 PM ---------- Previous update was at 01:28 PM ----------

POSIX Pathname Resolution (section 4.11):



Regards,
Alister

thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

2. Solaris

Question about directory structure

I have a Solaris 9 system and was trying to familiarize myself with how the filesystem is laid out. I was wondering what the following directories were for (legacy, some administrative reason, etc) The reason I ask about these specific directories is that they have executables with the... (4 Replies)
Discussion started by: thmnetwork
4 Replies

3. Shell Programming and Scripting

Checking directory permissions on UNIX directory

Hi, How do i check if I have read/write/execute rights on a UNIX directory? What I'm doing is checking read access on the files but i also want to check if user has rights on the direcory in whcih these files are present. if then...... And I check if the directory exists by using... (6 Replies)
Discussion started by: chetancrsp18
6 Replies

4. UNIX for Dummies Questions & Answers

Unix directory system calls question

I'm currently studying for my exam, and is practicing with sample exam questions. However there is a question asking "Name THREE UNIX Directory system calls" and the answer given is "opendir, closedir and readdir", however the next question ask "Why is a write directory system call not included... (1 Reply)
Discussion started by: Izzy123
1 Replies

5. Shell Programming and Scripting

File transfer from one directory to another directory in unix

Hi, I have to transfer five files from one directory to another directory in unix with the help of shell scripts. This shell script calling the param file as input parameter. Every day one file will come and fall on my source directory. Remaining files will fall on any one of the day of the... (5 Replies)
Discussion started by: easterraj
5 Replies

6. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

7. UNIX for Dummies Questions & Answers

home directory & group in UNIX question

folks; I'm going to use LDAP on Solaris 10 to authenticate users, i have 3 questions, i'm hoping it can be possible: 1. when users login for the first time, Is there a way to auto create a home directory like "/home/"user_name" so we don't have to a create a home directory for every single... (3 Replies)
Discussion started by: Katkota
3 Replies

8. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

9. UNIX for Dummies Questions & Answers

Unix History Question: Why are filenames/dirnames case sentsitive in Unix?

I tried looking for the answer online and came up with only a few semi-answers as to why file and directory names are case sensitive in Unix. Right off the bat, I'll say this doesn't bother me. But I run into tons of Windows and OpenVMS admins in my day job who go batty when they have to deal... (3 Replies)
Discussion started by: deckard
3 Replies

10. UNIX for Dummies Questions & Answers

moving files from a unix directory to a windows directory

Any body any ideas i'm failry new to this so any help would be appreciated. Cheers Steve (2 Replies)
Discussion started by: gleads
2 Replies
Login or Register to Ask a Question