Skip to main content

Questions tagged [bash]

This challenge is related to the Bash (Bourne Again SHell) language. Note that challenges that require the answers to be in a specific language are generally discouraged.

2 votes
1 answer
345 views

I'm pretty new to code golfing, but I recently came across a guy on Kattis that consistently has exactly 5 character Bash solutions for some problems. For example, here is a leaderboard showing his 5 ...
Donald Trump's user avatar
1 vote
2 answers
351 views

The well known cat command simply copies its stdin directly to stdout unchanged. But there are plenty of other commandline tools that exist... What other commands ...
CarmenCarmen's user avatar
1 vote
1 answer
279 views

Challenge You find yourself in a bash terminal, and want to do some simple tests on sqlite3. So you issue the following command: ...
ChrisB's user avatar
  • 119
9 votes
5 answers
638 views

I'm trying to shorten a bash solution to a Code Golf challenge, which requires an output of true or false. I've managed to ...
ShadowRanger's user avatar
-4 votes
4 answers
320 views

Background When you run tail -f file in bash, the file is outputted and then any subsequent appends. However, when you remove something that has already been ...
user avatar
8 votes
1 answer
638 views

Let us play a little golfing game. Given a single line of N space separated numbers from STDIN, one must output those numbers on N lines. So far, I came up with the three following bash solutions : ...
Brett's user avatar
  • 89
6 votes
4 answers
558 views

I have this code : tr ' ' '\n'|sort -n|head -1 The code is pretty simple, it takes a list of integer in the standard input stream (like ...
Magus's user avatar
  • 163
12 votes
1 answer
623 views

The Situation Suppose I allow "Shady Sam" admin access on my workstation to perform an important administrative task on my Mac Pro for me by giving them a temporary root login password. (Assume they ...
jvriesem's user avatar
  • 299
70 votes
43 answers
13k views

What general tips do you have for golfing in Bash? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Bash (e.g. "remove comments" is not ...
manatwork's user avatar
  • 20.9k