Questions tagged [conventions]

Naming conventions and best practice

Filter by
Sorted by
Tagged with
190
votes
4answers
101k views

Why do we use su - and not just su?

I don't understand why su - is preferred over su to login as root.
62
votes
8answers
10k views

Why does Bash's source not need the execution bit?

With Bash's source it is possible to execute a script without an execution bit set. This is documented and expected behaviour, but isn't this against the use of an execution bit? I know, that source ...
56
votes
17answers
14k views

Why do Unix-heads say “minus”? [closed]

A couple of weeks ago I attended a talk on Git by someone who seemed to be from a Windows background. I say "seemed to be" because he kept saying "dash" when referring to command-line options. I ...
60
votes
2answers
17k views

Why are shared libraries executable?

Why have almost all the shared libraries in /usr/lib/ have the executable permission bit set? I don't see any use case for executing them. Some do manage to hook-up some form of main function to print ...
49
votes
7answers
105k views

File extensions for unix shell scripts [closed]

On wikipedia, the article for .sh says: For the .sh file extension type, see Bourne shell. How about other unix shells? I know that the shebang is used inside the file to indicate an ...
6
votes
3answers
2k views

Best directory for shared scripts

What is the conventional directory to keep shared scripts that might be used by more than one user? I've read through this overview of the standard file system hierarchy, but it doesn't seem to ...
1
vote
2answers
182 views

Mount point for system-wide USB disk

I have a USB disk connected to a server computer which is mounted when the computer starts. I'm thinking that it's not ideal to mount it under the /media directory since it could potentially lead to a ...
9
votes
2answers
1k views

When to use standard error stream in command-line application?

Is there a guideline when to use the error when writing a command-line application? To my surprise, I didn't find anything when googling it. In particular, the question I'm concerned with right now ...
5
votes
1answer
321 views

Why do some utilities parse operands before options?

According to several sources, the UNIX utility guidelines specify that operands should always be processed after options: utility_name[OPTIONS][operands...] Some older UNIX utilities are known to ...
2
votes
3answers
519 views

Will it be bad that a function or script name contains dash `-` instead of underline `_`?

If I name a function or script with dash - instead of underline _ between words, would that be bad? For example, function duplicate-me() or duplicate-me.sh. In bash, a variable name can contains ...