10-09-2009
Hi.
On Solaris you will.
If you are using Solaris, use /usr/xpg4/bin/awk.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
G'day all
Just wondering if anyone can help me, is it possible, within a Bourne Shell script, to check if a entered file exists? :confused:
An example would be (And this is the reason why I'm asking) If I was to write a super-basic backup script, and the user entered a filename, what sort of... (2 Replies)
Discussion started by: Aussie_Bloke
2 Replies
2. Shell Programming and Scripting
now, what do you define as core files.
there are some files outthere with the name perl.core, I-core.png, core.png
I mean, are these classified as core files too??? i thought core files are simply files called "core". Please help me out
this is urgent (2 Replies)
Discussion started by: TRUEST
2 Replies
3. UNIX for Dummies Questions & Answers
Hi
i am trying to read a line from a file and add the values in a new file
eg
Input file
a1|a2|a3|a4|a5|a6
b1|b2|b3|b4|b5|b6
c1|c2|c3|c4|c5|c6
expected output
File one
a1|a2|a3
b1|b2|b3
c1|c2|c3 (3 Replies)
Discussion started by: rysh
3 Replies
4. Shell Programming and Scripting
hi i have cancelled my previous post (2 Replies)
Discussion started by: choco4202002
2 Replies
5. Shell Programming and Scripting
I want to grep "abc" from "logyy". I want not only the instance of "abc" to return, but the line just above it as well (no matter what it is).
:)
Can some one please assit me to drive on this (2 Replies)
Discussion started by: NIMISH AGARWAL
2 Replies
6. Solaris
I have sunfire question and getting the following error message through prtdiag.
MB/P0/F0 RS failed 0 rpm
What it means? Please help me ASAP. (2 Replies)
Discussion started by: mokkan
2 Replies
7. HP-UX
I have a make_recovery tape, if I restore the VG00 volume group using this, will my other volume groups still be ok after the restore(I have 7 data volume groups)
I used make_recovery -A to create the tape
I have a HP9000 HP-UX 11
An internal disk is failing, the other volume groups are on... (3 Replies)
Discussion started by: rees_a
3 Replies
8. UNIX for Advanced & Expert Users
I have a file like below. I need from each group of messages only first lines after error. Could you pleasde help me to write a correct program?
expected output is like this "Error 126614 in debt instrument header for debt instrument ID 10115537: The
rating reason RATING AFFIRMED selected for... (1 Reply)
Discussion started by: digioleg54
1 Replies
LEARN ABOUT OPENSOLARIS
basename
basename(1) User Commands basename(1)
NAME
basename, dirname - deliver portions of path names
SYNOPSIS
/usr/bin/basename string [suffix]
/usr/xpg4/bin/basename string [suffix]
dirname string
DESCRIPTION
The basename utility deletes any prefix ending in / and the suffix (if present in string) from string, and prints the result on the stan-
dard output. It is normally used inside substitution marks (``) within shell procedures.
/usr/bin
The suffix is a pattern defined on the expr(1) manual page.
/usr/xpg4/bin
The suffix is a string with no special significance attached to any of the characters it contains.
The dirname utility delivers all but the last level of the path name in string.
EXAMPLES
Example 1 Setting environment variables
The following example, invoked with the argument /home/sms/personal/mail sets the environment variable NAME to the file named mail and the
environment variable MYMAILPATH to the string /home/sms/personal:
example% NAME=`basename $HOME/personal/mail`
example% MYMAILPATH=`dirname $HOME/personal/mail`
Example 2 Compiling a file and moving the output
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
directory:
example% cc $1
example% mv a.out `basename $1 .c`
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of basename and dirname: LANG, LC_ALL,
LC_CTYPE, LC_MESSAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
/usr/bin
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
/usr/xpg4/bin
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWxcu4 |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
expr(1), basename(3C), attributes(5), environ(5), standards(5)
SunOS 5.11 18 Mar 1997 basename(1)