Results 1 to 6 of 6

Thread: What's the difference between semicolons & hash characters in config files?

  1. #1
    Join Date
    May 2007
    Location
    USA
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    What's the difference between semicolons & hash characters in config files?

    Ok guys, here's an easy one.

    I'm messing with my samba config file. For line comments, some use a number sign/pound sign/hash symbol, while other lines use a semicolon:

    Code:
    ############ Misc ############
    
    # Using the following line enables you to customise your configuration
    # on a per machine basis. The %m gets replaced with the netbios name
    # of the machine that is connecting
    ;   include = /home/samba/etc/smb.conf.%m
    
    # Most people will find that this option gives better performance.
    # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
    # for details
    # You may want to add the following on a Linux system:
    #         SO_RCVBUF=8192 SO_SNDBUF=8192
    #   socket options = TCP_NODELAY
    
    # The following parameter is useful only if you have the linpopup package
    # installed. The samba maintainer and the linpopup maintainer are
    # working to ease installation and configuration of linpopup and samba.
    ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
    
    # Domain Master specifies Samba to be the Domain Master Browser. If this
    # machine will be configured as a BDC (a secondary logon server), you
    # must set this to 'no'; otherwise, the default behavior is recommended.
    #   domain master = auto
    
    # Some defaults for winbind (make sure you're not using the ranges
    # for something else.)
    ;   idmap uid = 10000-20000
    ;   idmap gid = 10000-20000
    ;   template shell = /bin/bash
    What is the difference between the two?

  2. #2
    Join Date
    Sep 2008
    Location
    Ohio
    Beans
    963
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: What's the difference between semicolons & hash characters in config files?

    According to 'man smb.conf':
    Quote Originally Posted by man smb.conf
    Any line beginning with a semicolon (“;”) or a hash (“#”) character is ignored, as are lines containing only whitespace.

  3. #3
    Join Date
    Sep 2007
    Location
    Oklahoma, USA
    Beans
    2,165
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: What's the difference between semicolons & hash characters in config files?

    The hash mark is recognized as a comment flag by almost all *nix programs; the semicolon by only a few. When in doubt, use the hash mark.

    That said, the Samba configuration file uses them both to convey a slight difference in significance. The hash mark indicates a true comment, while the semicolon indicates the default value of an attribute. If you want to change to a non-default value, just change it and remove the semicolon, or alternatively leave the line alone and insert a new one following it to define the new value.
    --
    Jim Kyle in Oklahoma, USA
    Linux Counter #259718
    Howto mark thread: https://wiki.ubuntu.com/UnansweredPo.../SolvedThreads

  4. #4
    Join Date
    May 2007
    Location
    USA
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: What's the difference between semicolons & hash characters in config files?

    JKyleOKC and marshmallow1304, thanks for your replies!
    Quote Originally Posted by JKyleOKC View Post
    The hash mark is recognized as a comment flag by almost all *nix programs; the semicolon by only a few. When in doubt, use the hash mark.

    That said, the Samba configuration file uses them both to convey a slight difference in significance. The hash mark indicates a true comment, while the semicolon indicates the default value of an attribute. If you want to change to a non-default value, just change it and remove the semicolon, or alternatively leave the line alone and insert a new one following it to define the new value.
    JKyleOKC, that answered my question, thank you very much!

  5. #5
    Join Date
    Mar 2011
    Location
    Oceanside
    Beans
    427
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: What's the difference between semicolons & hash characters in config files?

    Last night I ran across another one. The vim config file uses double quotes for comments.
    Dan
    I wish my computer would do what I wanted it to do instead of what I told it to do.

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: What's the difference between semicolons & hash characters in config files?

    Quote Originally Posted by 5149.5 View Post
    Last night I ran across another one. The vim config file uses double quotes for comments.
    /Off topic

    <-- html !-->
    -- lua
    ## grub (1)
    // php, javascript
    /* php , javascript, css */

    As as you can see, depends on the interpreter.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Tags for this Thread

Bookmarks

Posting Permissions

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