You are not logged in.
Pages: 1
It's probably a stupid question but reading through wiki about configuring and securing ssh/sshd it tells me to change commented lines and keeps them commented in the examples. I guess I should uncomment the lines but I wanted the opportunity to ask this at the same time. Are there exceptions to the comment rule (except for RE)? In that case which are they and how do I recognise them? I mean:
#MaxStartups 10
Must be a comment in every occasion right?
/Richard
If you must have must. Have must.
- DKE supporters about this wonderful swedish soda.
Offline
So far I haven't come across a script or config file where # wasn't a comment.
A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.
Offline
Here is a thought, I'm new to linux scripts...
#!/bin/bash
This is a comment, but some editors, prosseses, etc. watch for it to know how to handle the file. But in reality, it is still just a comment?
Offline
It's called a sha-bang and indicates which interpreter will be used to run the program.
If you must have must. Have must.
- DKE supporters about this wonderful swedish soda.
Offline
No, the rule isn't "# Something" must be a comment in every occasion - # is used for a comment in shell scripts, sure, but config files could easily have some sort of proprietary setup where comments are something completely different.
If you're not sure, ask the developers of the app how to insert comments into the config file.
Offline
The real lesson here is that every language could have a different way to mark comments. Most shells use #, C++ is // and /* */, Lua is --, .Xdefaults is !, and there are tons of other examples.
Most config files do use # as a comment, but you really need to learn more about programming languages and applications. There are no concrete rules here.
Offline
I'm referring to bash here. All regular scripts in arch are written in bash no? It's the ssh_config and the sshd_config files. I found a man page where it said that:
Empty lines and lines starting with `#' are comments.
Problem solved, however, shouldn't I assume that any "regular" script with a line starting with # is really a comment?
If you must have must. Have must.
- DKE supporters about this wonderful swedish soda.
Offline
You should only assume that if a script starts with:
#!/bin/bash
or any other known shell.
If by "regular" you mean bash, then yes.
Offline
I thought I recalled the php.ini being commented with ';'.
Offline
Ok thanks. Just needed to know the standards so I don't mess up things without knowing it. But I recall that .bashrc and similiar files do not start with a sha-bang. Aren't these bash scripts?
If you must have must. Have must.
- DKE supporters about this wonderful swedish soda.
Offline
.bashrc is an initialization file that bash will execute commands from if an interactive shell is started (and no options are present to prevent it or change where initialization commands are executed from)
man 1 bash
Offline
It all just depends on what file you are editing, for config files
#
are usually used for commenting, but on alot of languages the comment operator may var from alnguage to language. All you simply got to mainly do is become firmiliar with different programming languages syntax, that way you'll know what the comment operator for that language.
Offline
Pages: 1