Sponsored Content
Top Forums UNIX for Beginners Questions & Answers What is the difference ../directory path and ./directory path in ksh? Post 303043206 by Scrutinizer on Tuesday 21st of January 2020 11:15:35 AM
Old 01-21-2020
Hi,

.. refers to the parent directory
. refers to the current directory
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Determining directory path

Hello, I have a script where I get the full directory path of the script being executed: BASE=$0 echo "BASE:" $BASE The output looks like this: BASE: /webapps/appsdev/ACURA/rlz/oses3.sh I'd like to truncate the shell name, leaving just the directory path. The directory path can be... (2 Replies)
Discussion started by: cwalsek
2 Replies

2. UNIX for Dummies Questions & Answers

ksh - walking back up a directory PATH

Hi there, I am putting a script together to apply a label to a directory structure but it can't be done down the directory structure, i must start at the end and work back and this is what i am struggling with. for example, i will supply a path as an argument to a script, e.g ... (11 Replies)
Discussion started by: surfbus78
11 Replies

3. UNIX for Dummies Questions & Answers

How to get directory name from its path?

If I the path to a directory, what command can I use to return the actual name of that directory. test=`pwd`/folder1 > $test folder1 I'd rather avoid anything with regular expressions. Any ideas? (1 Reply)
Discussion started by: ordano
1 Replies

4. HP-UX

change directory path

Hi, when ever i login my unix system it is going to root directory....how can i change it specified directory.. (3 Replies)
Discussion started by: rsivasan
3 Replies

5. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

6. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

7. Shell Programming and Scripting

How to get last directory path in script

I have a below directory name /root/logs/testing/today/ Here i have get to the value as '/root/logs/testing/' only without the last directory in a shell script. Do i need to use substr function here. Is there any other way around (6 Replies)
Discussion started by: vel4ever
6 Replies

8. Shell Programming and Scripting

Keep last directory from path

Hello, I am looking for a command that will give me the last directory name from a path ex 1 : /dir1/dir/2/dir3/ output needed dir3 ex 2 : /dir1/dir/2/dir3/dir4/ output needed dir4 (1 Reply)
Discussion started by: Aswex
1 Replies

9. 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

10. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies
pathconf(2)							System Calls Manual						       pathconf(2)

NAME
pathconf(), fpathconf() - get configurable path name variables SYNOPSIS
DESCRIPTION
The and functions provide a method for applications to determine the value of a configurable limit or option associated with a file or directory (see limits(5) and For the path argument points to the path name of a file or directory. For the fildes argument is an open file descriptor. For both functions, the name argument represents the variable to be queried regarding the file or directory to which the other argument refers. The following table lists the configuration variables available from and and lists for each variable the associated value of the name argu- ment: | | Variable | Value of name | Notes ------------------------+----------------------+---------- LINK_MAX | _PC_LINK_MAX | 1 MAX_CANON | _PC_MAX_CANON | 2 MAX_INPUT | _PC_MAX_INPUT | 2 | _PC_FILESIZEBITS | 3, 4, 10 NAME_MAX | _PC_NAME_MAX | 3, 4 PATH_MAX | _PC_PATH_MAX | 4, 5 PIPE_BUF | _PC_PIPE_BUF | 6 _POSIX_ASYNC_IO | _PC_ASYNC_IO | 1, 11 _POSIX_CHOWN_RESTRICTED | _PC_CHOWN_RESTRICTED | 7, 8 _POSIX_NO_TRUNC | _PC_NO_TRUNC | 3, 4 _POSIX_PRIO_IO | _PC_PRIO_IO | 1, 12 _POSIX_SYNC_IO | _PC_SYNC_IO | 9 _POSIX_VDISABLE | _PC_V_DISABLE | 2 The variables in the table are defined as constants in or if they do not vary from one path name to another. The associated values of the name argument are defined in RETURN VALUE
The following notes further qualify the table above. 1. If path or fildes refers to a directory, the value returned applies to the directory itself. 2. If the variable is constant, the value returned is identical to the variable's definition in or regardless of the type of fildes or path. The behavior is undefined if path or fildes does not refer to a terminal file. 3. If path or fildes refers to a directory, the value returned applies to the file names within the directory. 4. If path or fildes does not refer to a directory, or returns -1 and sets to 5. If path or fildes refers to a directory, the value returned is the maximum length of a relative path name when the specified directory is the working directory. 6. If path refers to a FIFO, or if fildes refers to a pipe or FIFO, the value returned applies to the pipe or FIFO itself. If path or fildes refers to a directory, the value returned applies to any FIFOs that exist or can be created within the direc- tory. If is a constant, the value returned is identical to the definition of in regardless of the type of fildes or path. The behavior is undefined for a file other than a directory, FIFO, or pipe. 7. If path or fildes refers to a directory, the value returned applies to files of any type, other than directories, that exist or can be created within the directory. 8. is defined if the privilege group has been granted the privilege (see getprivgrp(2) and chown(2)). In all other cases, is undefined and or returns -1 without changing To determine if can be performed on a file, it is simplest to attempt the opera- tion and check the return value for failure or success. 9. when defined, determines whether synchronized IO operations may be performed for the associated file (see open(2)). If path or fildes refers to a directory, it is unspecified whether or not the implementation supports an association of the variable name with the specified file. 10. For file systems that are not large file enabled, the return value will be less than or equal to 32. For file systems that are large file enabled, the return value will be between 33 and 63. 11. when defined, determines whether asynchronous I/O operations may be performed for the associated file. 12. when defined, determines whether prioritized I/O is supported for the associated file. If the variable corresponding to name is not defined for path or fildes, the and functions succeed and return a value of -1, without chang- ing the value of Upon any other successful completion, these functions return the value of the named variable with respect to the specified file or direc- tory, as described above. Otherwise, a value of -1 is returned and is set to indicate the error. ERRORS
The and fail if any of the following conditions are encountered: A component of the path prefix denies search permission. The fildes argument is not a valid open file descriptor. path points outside the allocated address space of the process. The value of name is not valid or the implementation does not support an association of the variable name with the speci- fied file. Too many symbolic links were encountered in translating path. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. The file named by path does not exist (for example, path is null, or a component of path does not exist). A component of the path prefix is not a directory. EXAMPLES
The following example sets val to the value of for the device file being used as the standard input. If the standard input is a terminal, this value is the maximum number of input characters that can be entered on a single input line before typing the newline character: The following code segment shows two calls to pathconf. The first determines whether a file name longer than bytes will be truncated to bytes in the directory. If so, the second call is made to determine the actual value of so that an error can be printed if a user-supplied file name stored in filebuf will be truncated in this directory: DEPENDENCIES
NFS The following error can occur: path or fildes refers to a file for which a value for name cannot be determined. In particular, and cannot be deter- mined for an NFS file. AUTHOR
and were developed by HP. SEE ALSO
chown(2), errno(2), limits(5), unistd(5), termio(7). STANDARDS CONFORMANCE
pathconf(2)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy