On Mon, 29 Sep 2008, drek wrote:-
Hello,
In a script I want to know in which directory I am, but I don't want to know the whole path.
This should do: WHICHEVER_VARIABLE_NAME_YOU_WANT=${PWD##*/} ^ ^ And these are curly braces.
I thought it was easy, but I got an errormessage:
drek@laptop:~> pwd | basename basename: missing operand Try `basename --help' for more information.
I expected to get the output from pwd ( /home/drek/ ) piped to basename. So I expected to get "drek" as the final result. But unfortunately....
Anyone with an explanation?
As others have mentioned, basename requires an argument. As you don't supply one, basename complains. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32 | | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org