Linked Questions
20 questions linked to/from What does it mean to be "sh compatible"?
1 vote
0 answers
91 views
history - bash, dash, zsh and .profile [duplicate]
For a long time I have been wondering about the existence of many shells in GNU/Linux. To make the question a bit focused I have used only three shells - bash, dash and zsh. From wikipedia articles ...
1 vote
0 answers
29 views
Shell Script Execution with Bash and without bash on command line [duplicate]
I have a shell script that reads data from a file and stores it into an array. When i execute the script like bash scriptname.sh i dont get any errors but when i execute it using sh scriptname.sh i ...
147 votes
4 answers
198k views
What is the difference between ~/.profile and ~/.bash_profile?
What is the difference between ~/.profile and ~/.bash_profile?
57 votes
3 answers
20k views
A layman's explanation for "Everything is a file" — what differs from Windows?
I know that "Everything is a file" means that even devices have their filename and path in Unix and Unix-like systems, and that this allows for common tools to be used on a variety of resources ...
44 votes
3 answers
31k views
Where does Mac OS X come from?
Discussing with Mac owners, I got several versions of where Mac OS X comes from. It is known to have some root in BSD, but how much, and where? Some say that Mac OS X has a FreeBSD kernel, with all ...
25 votes
3 answers
20k views
How complex can a program be written in pure Bash? [closed]
After some very quick research, it seems Bash is a Turing-complete language. I wonder, why is Bash used almost exclusively to write relatively simple scripts? Since a Bash shell comes with Linux, you ...
23 votes
3 answers
8k views
What is the fastest way to run a script?
I was wondering what is the fastest way to run a script , I've been reading that there is a difference in speed between showing the output of the script on the terminal, redirecting it to a file or ...
23 votes
3 answers
4k views
Are there still systems around with a /bin/sh binary?
/bin/sh, the Bourne shell created in 1977, used to be the default shell for Unix systems. Nowadays this file still exists but mostly just as a symbolic link to the default POSIX-compatible shell ...
14 votes
11 answers
6k views
How to get the last argument to a /bin/sh function
What's a better way to implement print_last_arg? #!/bin/sh print_last_arg () { eval "echo \${$#}" # this hurts } print_last_arg foo bar baz # baz (If this were, say, #!/usr/bin/zsh instead of #...
16 votes
2 answers
33k views
What is the difference between `ash` and `sh` shell on Linux?
I am new to a lot of tools on Linux. A quick search did not help, I only got more about bash or sh, and searching for it somehow leans towards bash in the search results. There are quite a few ...
11 votes
4 answers
20k views
How can I access the history buffer in sh? (not in Bash)
Is there a command history in sh, for example how to access it, and as well, how to ensure it is clear? To clarify shells here: let's say you've logged on to a non-Gui Linux system, and $SHELL is ...
4 votes
4 answers
484 views
Getting search results for Bourne shell [closed]
So, there are many types of shells in Linux... Different Types of Shells in Linux The Bourne Shell (sh) ... The GNU Bourne-Again Shell (bash) ... The C Shell (csh) ... The Korn Shell (ksh) ... The Z ...
1 vote
5 answers
772 views
IF construct in Solaris box to compare hh:mm:ss
I had created the below script which does the comparison between hh:mm:ss format variables. #!/bin/sh lag=00:00:00 MAX_LAG=00:05:00 echo $lag echo $MAX_LAG if [ "$lag" \< "$MAX_LAG" ] ##if [ "$...
0 votes
2 answers
5k views
Set LS_COLORS in Alpine
I am trying to set the directory colors in alpine to be white. I tried to create ~/.profile with LS_COLORS=$LS_COLORS:'di=1;44:' ; export LS_COLORS in it. But it had no effect. I see many examples ...
0 votes
2 answers
3k views
Why sh has a symbolic link to dash or bash?
I found that sh is a symbolic link to bash lrwxrwxrwx 1 root root 4 May 9 15:23 /bin/sh -> bash I tried to find a reason and i found out that bash is a implementation of sh and can behave like sh ...