Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Whats the % symbol mean?

  1. #1
    Join Date
    Jun 2009
    Location
    Mt Vernon Ohio
    Posts
    227

    Default Whats the % symbol mean?

    seen it more in Windows than Linux but nonetheless I was always curious what does the % mean/do? Thanks

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Whats the % symbol mean?

    In what context?

  3. #3
    Join Date
    Jun 2009
    Location
    Mt Vernon Ohio
    Posts
    227

    Default Re: Whats the % symbol mean?

    in scripts...now I'm even more curious what other context could there be?

  4. #4
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,497

    Default Re: Whats the % symbol mean?

    In searches it usually means 'any number of characters'; so %word% means 'find 'word' with any number of characters before and after it. word% means find 'word' at the start but with any number of characters after it.

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Whats the % symbol mean?

    The % character is of course as you know, the percent sign. So like many other punctuation characters, it's pressed into service to indicate something special in computer languages. So the meaning depends on the language. I believe in DOS BAT scripts, it's used to surround parameters, but it's been so long since I wrote a BAT file.

    In RPM spec files, it starts a macro. In bash scripts it's used in substitutions. In SQL it's used with the LIKE operator. In C printf statements it begins a format specifier. So there are as many interpretations as there are contexts.

  6. #6
    Join Date
    Jun 2009
    Location
    Mt Vernon Ohio
    Posts
    227

    Default Re: Whats the % symbol mean?

    alright elaborate a bit...when I click on my k3b icon settings on my desktop and browse to the command path it is k3b %U (I've seen the %U in alot of command shortcuts) what exactly does the %U mean? because it doesn't seem to fit the description of the command you gave me. Thanks

  7. #7
    Join Date
    Jun 2009
    Location
    Mt Vernon Ohio
    Posts
    227

    Default Re: Whats the % symbol mean?

    ah wow ken do I have alot to learn...I thought that special characters were pretty universal...guess not.

  8. #8

    Default Re: Whats the % symbol mean?

    Quote Originally Posted by threatingbehaviour View Post
    ...now I'm even more curious what other context could there be?
    In the context of a good whisky it means something clearly above 40.

    :-)

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Whats the % symbol mean?

    It's a substitution indicator. You should look up the KDE docs in connection with launchers, but I think %U means substitute the path of the object that triggered this launcher, e.g. the ISO file. So the k3b program will get called with the path as the first argument.

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,951

    Default Re: Whats the % symbol mean?

    Quote Originally Posted by john_hudson View Post
    In searches it usually means 'any number of characters'; so %word% means 'find 'word' with any number of characters before and after it. word% means find 'word' at the start but with any number of characters after it.
    That must also be in some context. In any case not in regular expressions. When I do a search for files having names with word somewhere in them with find, it would be something like
    Code:
    find ./ -name '*word*'
    BTW in an URL the % is preceding a hex code for a character outside the allowed character set for an URL.
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •