For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > Bash > Current Directory

Current Directory

Created by dave. Last edited by dave, 5 years and 17 days ago. Viewed 1,281 times. #1
[edit] [rdf]
labels
attachments
(2013-11-25)

Problem

What is the current directory called?

Solution

"${PWD##*/}"
This is suitable for shell scripts; for example:
TARGET="${PWD##*/}"
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt