Linked Questions

1 vote
0 answers
91 views

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 ...
shirish's user avatar
  • 13k
1 vote
0 answers
29 views

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 ...
vaibhav kumar's user avatar
147 votes
4 answers
198k views

What is the difference between ~/.profile and ~/.bash_profile?
lakshmen's user avatar
  • 6,571
57 votes
3 answers
20k views

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 ...
Mohamed Ahmed's user avatar
44 votes
3 answers
31k views

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 ...
Didier Trosset's user avatar
25 votes
3 answers
20k views

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 ...
Bregalad's user avatar
  • 1,035
23 votes
3 answers
8k views

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 ...
Kingofkech's user avatar
  • 1,068
23 votes
3 answers
4k views

/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 ...
dr_'s user avatar
  • 32.4k
14 votes
11 answers
6k views

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 #...
kjo's user avatar
  • 16.4k
16 votes
2 answers
33k views

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 ...
questionto42's user avatar
11 votes
4 answers
20k views

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 ...
forgotstackxpassword's user avatar
4 votes
4 answers
484 views

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 ...
pgr's user avatar
  • 151
1 vote
5 answers
772 views

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 [ "$...
SinghVK's user avatar
  • 113
0 votes
2 answers
5k views

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 ...
Vaccano's user avatar
  • 105
0 votes
2 answers
3k views

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 ...
tycoon's user avatar
  • 160

15 30 50 per page