Sponsored Content
Top Forums Shell Programming and Scripting want the current directory without the absolute path Post 302087462 by cbkihong on Friday 1st of September 2006 06:26:06 AM
Old 09-01-2006
Try the basename command. Wil strip off anything except the last path segment.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Question about Restricting Search path of FIND to current directory

Hi, By default FIND command searches for matching files in all the subdirectories within the specified path. Is there a way to restrict FIND command's search path to only the specified directory and NOT TO scan its subdirectories. Any help would be more than appreciated. Thanks and Regards (2 Replies)
Discussion started by: super_duper_guy
2 Replies

2. UNIX for Dummies Questions & Answers

vi - replacing a relative path with absolute path in a file

Hi, I have a file with about 60 lines of path: app-defaults/boxXYZ....... I want to change this to /my/path/goes/here/app-defaults/boxXYZ, but of course vi doesn't like the regualr :s/old/new/ command. Is there any other quick way to do this? Thanks ;) (2 Replies)
Discussion started by: Yinzer955i
2 Replies

3. UNIX for Dummies Questions & Answers

tag/mark a file with current absolute path

Hi all, I need to mark a file with it's current location in the file system before being moved. This will enable the file to be restored back to it's original location. Can anyone provide any ideas about the best way to do this, at present i'm trying to use readlink -m to strip off the... (1 Reply)
Discussion started by: skinnygav
1 Replies

4. Shell Programming and Scripting

absolute path for a script ran with relative path

I have a script in which i want to print absolute path of the same script irrespective of path from where i run script. I am using test.sh: echo "pwd : `pwd`" echo "script name: $0" echo "dirname: `dirname $0`" when i run script from /my/test/dir/struct as ../test.sh the output i... (10 Replies)
Discussion started by: rss67
10 Replies

5. Shell Programming and Scripting

How to change Absolute path to Relative path

Hello, I have a doubt:- --------------------- Current script:- ################################################################################################ prefix=user@my-server: find . -depth -type d -name .git -printf '%h\0' | while read -d "" path ; do ( cd "$path" || exit $?... (4 Replies)
Discussion started by: sahil_jammu
4 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. UNIX for Dummies Questions & Answers

Setting the current directory path to terminal title

In ubuntu, I want to update the title of the terminal window with the current directory path. Any ideas how this can be achieved? ---------- Post updated at 02:22 PM ---------- Previous update was at 02:08 PM ---------- Done it ---------- Post updated at 02:30 PM ---------- Previous update... (2 Replies)
Discussion started by: kristinu
2 Replies

8. UNIX for Dummies Questions & Answers

How to convert relative path to absolute path?

Hello Everyone, I want to convert Relative Path - /home/stevin/data/APP_SERVICE/../datafile.txt to Absolute Path - /home/stevin/data/datafile.txt Is there a built-in tool in Unix to do this or any good ideas as to how can I implement this. -Steve (5 Replies)
Discussion started by: qwarentine
5 Replies

9. UNIX for Dummies Questions & Answers

How to get the current directory Path?

How to get the current directory Path in your prompt? i am getting a $ mark only in my prompt? Please help me with this (3 Replies)
Discussion started by: Abhishek0683
3 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
strip(1)							   User Commands							  strip(1)

NAME
strip - strip symbol table, debugging and line number information from an object file SYNOPSIS
strip [-lVx] file... DESCRIPTION
The strip command removes the symbol table SHT_SYMTAB and its associated string table, debugging information, and line number information from ELF object files. That is, besides the symbol table and associated string table, the following sections are removed: .line .debug* .stab* Once this stripping process has been done, limited symbolic debugging access is available for that file. Therefore, this command is nor- mally run only on production modules that have been debugged and tested. If strip is executed on a common archive file (see ar.h(3HEAD)) in addition to processing the members, strip removes the archive symbol ta- ble. The archive symbol table must be restored by executing the ar(1) command with the -s option before the archive can be linked by the ld(1) command. strip produces appropriate warning messages when this situation arises. strip is used to reduce the file storage overhead taken by the object file. OPTIONS
The amount of information stripped from the ELF object file can be controlled by using any of the following options. The following options are supported: -l Strip line number information only.Does not strip the symbol table or debugging information. -V Prints, on standard error, the version number of strip. -x Does not strip the symbol table. Debugging and line number information might be stripped. OPERANDS
The following operand is supported: file A path name referring to an executable file. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of strip: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/tmp/strp* Temporary files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbtool | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
ar(1), as(1), ld(1), mcs(1), elf(3ELF), tmpnam(3C), a.out(4), ar.h(3HEAD), attributes(5), environ(5), standards(5) NOTES
The symbol table section is not removed if it is contained within a segment or if the file is a relocatable object. The line number and debugging sections are not removed if they are contained within a segment or if their associated relocation section is contained within a segment. The strip command is used to remove a standard predefined set of sections from an ELF object file. To remove a user specified section by name, see mcs(1). SunOS 5.11 5 Oct 2007 strip(1)
All times are GMT -4. The time now is 09:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy