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)
I need to write a login script for multiple computers, however, one of the directories in question will have a different name from computer to computer.
~/Library/Application\ Support/Firefox/Profiles/<unique filename>.default/myfile
For the directory named <unique filename>.default , I... (2 Replies)
Hi friends,
Need your help. The question is:
1) We have directory '/SomeDirectory/SubDirectory'
2) And have symlink pointing to it like '/AnotherOneDirectory/symlink'
'/AnotherOneDirectory/symlink' -> '/SomeDirectory/SubDirectory'
3) Need to get real path without symlinks knowing only... (7 Replies)
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)
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)
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)
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)
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)
What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
LEARN ABOUT CENTOS
tcl_chdir
Tcl_GetCwd(3) Tcl Library Procedures Tcl_GetCwd(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_GetCwd, Tcl_Chdir - manipulate the current working directory
SYNOPSIS
#include <tcl.h>
char *
Tcl_GetCwd(interp, bufferPtr)
int
Tcl_Chdir(path)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter in which to report an error, if any.
Tcl_DString *bufferPtr (in/out) This dynamic string is used to store the current working directory. At the time of the call it should
be uninitialized or free. The caller must eventually call Tcl_DStringFree to free up anything stored
here.
char *path (in) File path in UTF-8 format.
_________________________________________________________________DESCRIPTION
These procedures may be used to manipulate the current working directory for the application. They provide C-level access to the same
functionality as the Tcl pwd command.
Tcl_GetCwd returns a pointer to a string specifying the current directory, or NULL if the current directory could not be determined. If
NULL is returned, an error message is left in the interp's result. Storage for the result string is allocated in bufferPtr; the caller
must call Tcl_DStringFree() when the result is no longer needed. The format of the path is UTF-8.
Tcl_Chdir changes the applications current working directory to the value specified in path. The format of the passed in string must be
UTF-8. The function returns -1 on error or 0 on success.
KEYWORDS
pwd
Tcl 8.1 Tcl_GetCwd(3)