Questions tagged [bash]
Bash is the shell from the GNU project. It is the standard shell on many Linux distributions and often available on other *NIXes.
38 questions
-2
votes
0
answers
80
views
Does an indentation style which uniquely identifies a column position to its role in the construct it belongs to make Bash code more readable? [closed]
I've just opened a relatively similar question
(why nobody indents Bash?)
on Stack Overflow.
What I'm asking here is whether do you think the facts
there is no type enforcing;
there is no indentation ...
-1
votes
2
answers
110
views
commonly used practices for deploying package primarily composed of bash scripts
I am working on a tool that primarily uses bash scripts and C++ code.
Generally I have experience with basic tools written in C and C++ in which we can have a build system like ./configure; make; ...
0
votes
1
answer
394
views
If statement best practice [duplicate]
I am reviewing best practice with if statements. Below in example A I include the entire code to be run and ensure it remains within the if statement. While for example B the code to be executed ...
2
votes
3
answers
2k
views
Is it pythonic to replace a bash script with series of subprocess calls
I have a pretty simple bash script which consists of a bunch of one liners and some simple logic.
Its been recommended that I rip the bash script apart and rewrite it all in python using subprocess. ...
13
votes
5
answers
4k
views
How should I version control my bash profile?
So I'm very comfortable with version control, and just thought to start tracking versions of my bash profile: ~/.bash_profile with the added benefit of being able to share my various aliases and such ...
0
votes
1
answer
392
views
Pcregrep vs Perl vs Python for bash scripting when needing advanced regex features [closed]
I've lately been using pcregrep to do Perl-style group matching when doing my bash scripts.
The problem with pcregrep is that it's not readily available on Linux machines in general.
An alternative ...
2
votes
0
answers
242
views
Implementing redundant GIT backup scheme
I want to push a local repo to multiple remote GIT repositories to achieve redundancy in my backup scheme. So, let's say I plan to use Github and BitBucket to host my repositories.
I have two ...
-1
votes
2
answers
360
views
Extensible way to create bash program
I have a bash script that should be extensible with additional functions with as little change to the script as possible.
The basic function is as follows. It loops through a list of files to check. ...
2
votes
1
answer
2k
views
Why should I use a Dockerfile instead of a batch script?
I'm new to Docker and feeling my way around. My plan is to build a typical web app using Nginx+Rails+Postgress, all of which will be in the one container. I'm not (currently) doing anything complex ...
0
votes
1
answer
222
views
Unix way of filtering/mapping/mapcatting records via the pipeline?
At home I use Linux and have for more than a decade. At work we use Windows and so I find PowerShell more familiar. I am a Linux/Unix fanboy at heart, but I've had greater success grokking the ...
0
votes
1
answer
288
views
Need advise for porting linux script to Win command line [closed]
I am creating app(script) that is used similar to RSS reader for specific webpage that doesn't have RSS.
So my app downloads that html page in defined intervals, checks new items and parses them into ...
3
votes
3
answers
2k
views
Recommended guidelines for declaring bash/sh variables
I have been programming in BASH for a while now and the scripts that I write are starting to get more complicated.
I realized that I started to bring in some habits from C/C++ and wanted to get ...
6
votes
2
answers
1k
views
Is bash "finished"? [closed]
Should bash be expected to change in ways that break non-trivial amounts of existing scripts at some point in the (near/<5y) future? How much change has it gone trough in the last ten years ...
11
votes
1
answer
11k
views
Is it possible to use python as a shell replacement? [duplicate]
Recently I was looking at python's shutil and subprocess etc... And I started wondering: wouldn't it be ok to use python instead of e.g. bash?
What am I missing?
2
votes
1
answer
379
views
Effective handling of variables in non-object oriented programming
What is the best method to use and share variables between functions in non object-oriented program languages?
Let's say that I use 10 parameters from DB, ID and 9 other values linked to it. I need to ...
13
votes
3
answers
4k
views
User Configuration of a Shell Script. Best practices?
I am writing a shell script with a few variables that should be configured by the user. There will be an installer for downloading and configuring the script, possibly by asking a series of question. ...
7
votes
1
answer
3k
views
Are these steps enough to put my bash script under GPL 3?
I have written a bash script I would like to put under GPL v3. I've read the GNU documentation
on How to Apply These Terms to Your New Programs and How to use GNU licenses for your own software. Still,...
10
votes
5
answers
6k
views
Improving performance for grepping over a huge file
I have FILE_A which has over 300,000 lines and FILE_B which has over 30 million lines. I created a Bash script that greps each line in FILE_A over in FILE_B and writes the result of the grep to a new ...
11
votes
5
answers
5k
views
Is it good practice to require a trailing forward slash in directory names?
I want to ask the user of my bash script to pass a directory path as argument. Which one of the following is a good programming practice?
Require that the user enter a trailing / (forward slash)
...