[ale] SHELL: get file name
Chris Coleman
chriscoleman at mail.clayton.edu
Tue Jul 2 12:58:52 EDT 2002
ABSFILE=/home/aaa/bbb/ddd/name.log
file=$(basename $ABSFILE)
echo $file
Chris Coleman,
Instructor
School of Technology
Clayton College and State University
Phone: 770-960-4282
-----Original Message-----
From: Zyman, Andy [mailto:zymana at hra.nyc.gov]
To: ale at ale.org
Sent: Tuesday, July 02, 2002 12:54 PM
To: 'ale at ale.org'
Subject: [ale] SHELL: get file name
Hello,
Some time ago i had the question "how to get dirname". Now i decided to go
even further :) and get filename.
So here we go:
ABSFILE=/home/aaa/bbb/ddd/name.log
question:
how can i get "name.log"?
I need to be flexible on the location - cann't hardcoded location.
I want to achive this in one step.
Right now i'm doing :
dirn=`dirname $ABSFILE`
echo $ABSFILE | sed 's/\'$ABSFILE'//g'
Thank You
Andy
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list