LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2011, 12:33 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
what is the difference between these two symbol


1) .
2) -.


I know the first symbol means current , what is the meaning of the second symbol ?

Thanks.
 
Old 05-12-2011, 01:01 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Be nice if you specified the context there. but I assume(!) you mean dirs, in which case
Code:
'.' = current dir
'..' = parent dir
'-' = dir you were prev in

#NB you can 'cd' to all, but the first would be pointless
Here's hoping that wasn't a homework qn ....
In any case, try these
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
Old 05-12-2011, 02:03 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
the reply ,

This is not homework , I am doing server admin task for a database server .

sorry , I am not too understand the use of '-.' , - mean previous path , what is the mean of -. ?

for example , I set PATH=-.:$PATH , what is -. mean ?
 
Old 05-12-2011, 02:36 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi,

which Shell are you using?

if you want to search for "-." in a manpage, you may use the searchcommand
Code:
/-\.
, both bash and ksh have some builtin functions which use this expression.

Markus
 
Old 05-12-2011, 07:59 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by markush View Post
Hi,

which Shell are you using?

if you want to search for "-." in a manpage, you may use the searchcommand
Code:
/-\.
, both bash and ksh have some builtin functions which use this expression.

Markus
I use bash .
 
Old 05-12-2011, 09:14 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That would mean someone was stupid enough to create a directory
with the name '-.' and added it to the PATH.

Last edited by Tinkster; 05-12-2011 at 10:46 PM.
 
Old 05-13-2011, 01:59 AM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
There are (at least) two sections in the Bash-manpage where '-.' is mentioned (but not according to pathes).

Markus
 
Old 05-13-2011, 05:37 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by markush View Post
There are (at least) two sections in the Bash-manpage where '-.' is mentioned (but not according to pathes).

Markus

Which version of bash is that?
GNU bash, version 3.1.17 has a few occurrences of the string '-.'.

But a quick glance will show that the period is only punctuation
terminating the sentence talking about the hyphen.


Cheers,
Tink
 
Old 05-13-2011, 05:49 PM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by Tinkster View Post
Which version of bash is that?
GNU bash, version 3.1.17 has a few occurrences of the string '-.'.
Code:
markus@samsung:~$ bash --version
GNU bash, version 4.1.10(2)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
markus@samsung:~$
Quote:
But a quick glance will show that the period is only punctuation
terminating the sentence talking about the hyphen.
...
Here the sections of the manpage
Code:
yank-last-arg (M-., M-_)
              Insert  the  last  argument  to  the  previous  command (the last word of the previous history
              entry).   With  an  argument,  behave  exactly  like  yank-nth-arg.    Successive   calls   to
              yank-last-arg  move back through the history list, inserting the last argument of each line in
              turn.  The history expansion facilities are used to extract the last argument, as if the  "!$"
              history expansion had been specified.
and
Code:
 insert-last-argument (M-., M-_)
              A synonym for yank-last-arg.
I don't think that the '.' is punctuation in these cases.

Markus
 
Old 05-13-2011, 11:08 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by markush View Post
Code:
markus@samsung:~$ bash --version
GNU bash, version 4.1.10(2)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
markus@samsung:~$
Here the sections of the manpage
Code:
yank-last-arg (M-., M-_)
              Insert  the  last  argument  to  the  previous  command (the last word of the previous history
              entry).   With  an  argument,  behave  exactly  like  yank-nth-arg.    Successive   calls   to
              yank-last-arg  move back through the history list, inserting the last argument of each line in
              turn.  The history expansion facilities are used to extract the last argument, as if the  "!$"
              history expansion had been specified.
and
Code:
 insert-last-argument (M-., M-_)
              A synonym for yank-last-arg.
I don't think that the '.' is punctuation in these cases.

Markus

No, it's not, but "M-.", in other words "press&hold Alt, then ." has
a completely different meaning from a textual "-." . Those are emcas-
like keybindings.



Cheers,
Tink

Last edited by Tinkster; 05-13-2011 at 11:09 PM.
 
1 members found this post helpful.
Old 05-14-2011, 02:19 AM   #11
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
thanks for the clarification, I was wondering what this charactes do and didn't understand it. I did not understand that it are keybindings (well, I didn't use Emacs since the year of 1996 )

But now it is clear that in the Bash-manpage there is no "-." mentioned and same thing for ksh.

Markus

Last edited by markush; 05-14-2011 at 02:22 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
symbol lookup error: /usr/lib/libavcodec.so.51: undefined symbol: av_crc04C11DB7 priceey Linux - Software 0 05-06-2009 08:14 AM
./firefox-bin :symbol lookup error:/lib/libgthread-2.0.so.0: undefined symbol: arulupsaras Linux - General 1 11-08-2008 04:48 AM
symbol lookup error: /usr/lib/libgtk-x11.2.0.so.0: undefined symbol:... IamI Slackware 17 02-29-2008 11:10 AM
Workaround: 'symbol lookup error: k3b: undefined symbol: lstat64' devdol Linux - Software 2 02-15-2008 03:36 AM
what's the difference between symbol and reference? jackandking Programming 1 01-24-2005 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration