Sponsored Content
Top Forums UNIX for Beginners Questions & Answers What is the difference ../directory path and ./directory path in ksh? Post 303043200 by TestKing on Tuesday 21st of January 2020 09:14:21 AM
Old 01-21-2020
What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh?
 

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
chdir(2)							System Calls Manual							  chdir(2)

Name
       chdir - change working directory

Syntax
       chdir(path)
       char *path;

Description
       The  path  is  the  pathname  of  a directory.  The system call causes this directory to become the current working directory, which is the
       starting point for pathnames that do not begin at the root directory (/).

       For a directory to become the current directory, the process must have execute (search) access to the directory.

Return Values
       Upon successful completion, a value of 0 is returned.  Otherwise, a value of -1 is returned and errno is set to indicate the error.

Environment
       Differs from the System V definition in that ELOOP is a possible error condition.

Diagnostics
       The system call fails and the current working directory is unchanged under the following conditions:

       [ENOTDIR]      A component of the pathname is not a directory.

       [ENAMETOOLONG] A component of a pathname exceeds 255 characters, or an entire path name exceeds 1023 characters.

       [ENOENT]       The named directory does not exist or the path points to an empty string and  the  environment  defined  is  POSIX  or  SYS-
		      TEM_FIVE.

       [EACCES]       Search permission is denied for any component of the path name.

       [EFAULT]       The path points outside the process's allocated address space.

       [ELOOP]	      Too many symbolic links were encountered in translating the pathname.

       [EIO]	      An I/O error occurred while reading from or writing to the file system.

       [ESTALE]       The  file  handle  given in the argument was invalid.  The file referred to by that file handle no longer exists or has been
		      revoked.

       [ETIMEDOUT]    A connect request or remote file operation failed because the connected party did not properly respond  after  a	period	of
		      time that is dependent on the communications protocol.

See Also
       chroot(2)

																	  chdir(2)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy