LinuxQuestions.org
Review your favorite Linux distribution.
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, 01:33 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
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, 02:01 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 03:03 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
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, 03:36 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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, 08:59 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
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, 10:14 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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 11:46 PM.
 
Old 05-13-2011, 02:59 AM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

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

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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 06:49 PM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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-14-2011, 12:08 AM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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-14-2011 at 12:09 AM.
 
1 members found this post helpful.
Old 05-14-2011, 03:19 AM   #11
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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 03:22 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:14 AM
./firefox-bin :symbol lookup error:/lib/libgthread-2.0.so.0: undefined symbol: arulupsaras Linux - General 1 11-08-2008 05:48 AM
symbol lookup error: /usr/lib/libgtk-x11.2.0.so.0: undefined symbol:... IamI Slackware 17 02-29-2008 12:10 PM
Workaround: 'symbol lookup error: k3b: undefined symbol: lstat64' devdol Linux - Software 2 02-15-2008 04:36 AM
what's the difference between symbol and reference? jackandking Programming 1 01-24-2005 12:24 PM


All times are GMT -5. The time now is 10:24 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration