10-19-2012
Strange!
You can use
basename to get the last part of a path.
As
sh means sh in Solaris, that's probably the easiest approach.
Edit: Seing that it's backslashes, not forward slashes,
basename might not cut it, but I don't understand if those are normal (ASCII) zero's why
sed would behave this way.
Edit 2: Duh! Because
sed treats \0 as a Null character!
Edit 3: That was a duh @ me, not a duh @ you
7 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
We need ur advice,...
We are integrating our application (oracle) with OID,and OID is with another team.
While integrating they have to provide their 'ADMIN-password' when the script prompts ,But the password they are about type is visible.
If this is the case they are denying it,....
Is... (1 Reply)
Discussion started by: rrs
1 Replies
2. UNIX for Dummies Questions & Answers
uname -a returns: SMP Tue May 17 17:52:23 EDT 2005 i686 athlon i386 GNU/Linux
I have many aliases beginning with "goto" so...
if I type goto and then hit return (oops)
A goto prompt pops up and I cant exit from it(I tried MANY key seqs)
The only way to exit is to kill the term window... (2 Replies)
Discussion started by: rairey
2 Replies
3. UNIX and Linux Applications
I have a burning desire to learn how to type in chinese (and after, probably with success, in another languages). How to do this, all symbols are needed, and methods of input also. And a map of chinese keyboar layout will be helpful.
I want very much study program. (3 Replies)
Discussion started by: Xcislav
3 Replies
4. Shell Programming and Scripting
Hello all,
I am in a terminal on Solaris and something weird is happening...
When I am typing I can't see what I am typing, although what I am typing is working. As is if I type the command and hit enter, the command runs.
Anyone have a clue why or how I can make it display my typing?
Is... (2 Replies)
Discussion started by: komputersman
2 Replies
5. UNIX for Advanced & Expert Users
Hi all,
When I use an editor (vi) that is spawned in a remote server, visually I could see the latency between typing a character/word and being displayed on the terminal. I could see this visually but how do I get a metric on this or how to quantify this?
As expected, when I type in a editor... (6 Replies)
Discussion started by: matrixmadhan
6 Replies
6. UNIX for Dummies Questions & Answers
Hi
As a dummy my question is very simple. When typing cw I've read (many times) that a '$' should appear at the end of the word I'm about to change. However, it doesn't, and in my case the word is instantly deleted and so ready to be changed!
Can somebody tell me why this is, or maybe I... (4 Replies)
Discussion started by: joesh
4 Replies
7. HP-UX
Dear Concern,
Please go through the article
https://www.unix.com/hp-ux/134072-typing-sign-creates-new-line.html
As per the article, we need to initiate below commands. But after creating new session, we face same problem. Please advise.
stty intr "^c"
stty kill "^u"
Please find below... (6 Replies)
Discussion started by: makauser
6 Replies
LEARN ABOUT OPENDARWIN
basename
BASENAME(1) BSD General Commands Manual BASENAME(1)
NAME
basename, dirname -- return filename or directory portion of pathname
SYNOPSIS
basename string [suffix]
basename [-a] [-s suffix] string [...]
dirname string
DESCRIPTION
The basename utility deletes any prefix ending with the last slash '/' character present in string (after first stripping trailing slashes),
and a suffix, if given. The suffix is not stripped if it is identical to the remaining characters in string. The resulting filename is
written to the standard output. A non-existent suffix is ignored. If -a is specified, then every argument is treated as a string as if
basename were invoked with just one argument. If -s is specified, then the suffix is taken as its argument, and all other arguments are
treated as a string.
The dirname utility deletes the filename portion, beginning with the last slash '/' character to the end of string (after first stripping
trailing slashes), and writes the result to the standard output.
EXAMPLES
The following line sets the shell variable FOO to /usr/bin.
FOO=`dirname /usr/bin/trail`
DIAGNOSTICS
The basename and dirname utilities exit 0 on success, and >0 if an error occurs.
SEE ALSO
csh(1), sh(1)
STANDARDS
The basename and dirname utilities are expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
BSD
April 18, 1994 BSD