Sponsored Content
Full Discussion: Help with this please
Top Forums UNIX for Dummies Questions & Answers Help with this please Post 302127994 by moe2266 on Friday 20th of July 2007 02:27:18 PM
Old 07-20-2007
Data Help with this please

Folks;
Can any one tell me what these commands below do:


user=$(/usr/ucb/whoami)

DZERO=${0}
PROG=$(basename ${DZERO})
while [ -h ${DZERO} ]; do
DZERO=$(ls -l ${DZERO} | awk '{print $NF}') done PDIR=$(dirname ${DZERO}) if [ ${PDIR} = '.' ]; then
PDIR=${PWD}
elif [ $(expr ${PDIR} : "\(.\).*") != '/' ]; then
PDIR=${PWD}/${PDIR}
fi

Smilie
 
basename(1B)					     SunOS/BSD Compatibility Package Commands					      basename(1B)

NAME
basename - display portions of pathnames SYNOPSIS
/usr/ucb/basename string [suffix] DESCRIPTION
The basename utility deletes any prefix ending in `/' and the suffix, if present in string. It directs the result to the standard output, and is normally used inside substitution marks (` `) within shell procedures. The suffix is a string with no special significance attached to any of the characters it contains. EXAMPLES
Example 1: Using the basename command. This shell procedure invoked with the argument /usr/src/bin/cat.c compiles the named file and moves the output to cat in the current direc- tory: example% cc $1 example% mv a.out `basename $1 .c` ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), attributes(5) SunOS 5.10 28 Mar 1995 basename(1B)
All times are GMT -4. The time now is 05:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy