Re: Some bash questions :-)



On Wednesday 30 August 2006 11:26, composlinuxmisc
<altcomphardware@xxxxxxxxxxx> wrote in comp.os.linux.misc:


Robert Hull wrote:
On Wednesday 30 August 2006 00:13, composlinuxmisc
<altcomphardware@xxxxxxxxxxx> wrote in comp.os.linux.misc:

The bash command below is meant to firstly list all files with the
specified name; and then print a line containing -2718.
[snip]
If I put the -2718 as "-2718" it still doesn't work (no terminated
signal, just Usage:...)

It should work if you escape the minus sign thus: '\-2718'

Yes, it does. Thanks. Goes to show there's usually more than one way
to do things in Linux. :-)

Indeed - I had forgotten the other way mentioned in this thread

What does the "\" symbol mean and how does it help?

In this context it is referred to as an escape character and tells the
software to treat the following character literally (i.e. do not try to
interpret the next character)
--
Robert HULL

Archival or publication of this article on any part of thisishull.net
is without consent and is in direct breach of the Data Protection Act
.



Relevant Pages

  • Re: % hack in password field
    ... you can use the optional ESCAPE clause to specify the escape character. ... FirstSQL/J Object/Relational DBMS ...
    (comp.lang.java.programmer)
  • Re: Escape sequence to dotmatrix printer - Escape() API
    ... We used to add chrto the text to represent the escape character. ... I Think it is CHRLook at the ANSII Character Codes, ... > internal struct structDevMode ...
    (microsoft.public.dotnet.framework)
  • Re: Escape character treatment in string library functions
    ... '\r' etc special making it difficult to parse even char by char. ... In C, the escape character only affects string literals, i.e. strings ...
    (comp.programming)
  • Re: Using _ as a character and not as a wildcard
    ... The databases have been prefixed with 'pl_'. ... > I can see in BOL that '_' is seen as a wildcard that can substitute any ... > single character, but how do I tell my query to use '_' as a part of the ... character after the defined escape character as a literal, ...
    (microsoft.public.sqlserver.server)
  • Re: vb to c# dll
    ... In C#, the \ character is an escape character. ... I'd also like to see my references in a folder in the solution ... I'm trying to pass a string containing a filepath from a vb.net forms ...
    (microsoft.public.dotnet.languages.csharp)