Bash is the shell from the GNU project. It is the standard shell on many Linux distributions and often available on other *NIXes.

learn more… | top users | synonyms

-2
votes
0answers
48 views

Improving command line skills [on hold]

I'd like to improve my Bash terminal skills, knowledge and muscle memory. There are a lot of books and tutorials out there, but what I'd really love some recommendations on drills or repetitive tasks ...
-4
votes
0answers
26 views

proper format for delimiting and grouping in bash? [closed]

say i have: arr=($(echo $(echo hello there) $(echo world))) i want for these commands: echo ${arr[0]} echo ${arr[1]} echo ${arr[2]} to print: hello there world (empty) however i get hello ...
0
votes
1answer
117 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 ...
13
votes
3answers
544 views

When is it appropriate to use colour in a command-line application?

Currently I have a command-line application in C called btcwatch. It has a -C option that it can receive as an argument that compares the current price of Bitcoin with a price that was stored ...
2
votes
2answers
788 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 ...
1
vote
1answer
2k views

Encoding a bash script for use in Python

I am writing some code in Python which checks for the validity of a license key after polling a server. If it is valid then the Python program in turn runs some bash scripts. How to create a ...
2
votes
1answer
1k views

Static code analysis for bash scripts

I program CLI utilities in bash to automate much of my work as a DBA. I would like improve my code and make it more robus,t maybe with the help of some static code analysis tool like the one I used ...
4
votes
2answers
438 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 ...
0
votes
2answers
265 views

Need some advice and feedback on my code's design

I am looking for feedback on the design of my program. I have a shell script call function.sh that defines a lot of helper functions. My intent is to use those bash functions defined in functions.sh ...
3
votes
1answer
2k 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?
0
votes
1answer
150 views

How do global cancel/exit commands work in bash?

As I have done multiple times before, I've written bash scripts, and just general commands that go nowhere. They just blink the little command line cursor at me for infinity until I control+C the ...
2
votes
1answer
269 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 ...
0
votes
0answers
328 views

Heredoc or an external template file in my bash script - how it affects readibility/maintanance?

I realise that this question may be down to personal preference but I'm pretty new to bash/shell scripting so thought it'd be worth some research to see if there's some sort of standard/best practise ...
8
votes
3answers
2k 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. ...
0
votes
1answer
108 views

Do accompanying tools/scripts also need to be licensed to put my bash script under GPLv3?

This is some sort of follow up to an older question of me. So I put the GPLv3 license into the project which contains my script and also added the copyright notice and copying permission statement to ...
3
votes
1answer
788 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. ...
3
votes
2answers
232 views

Are “backwards” terminators for if and case unique to shell scripting?

In bash at least, if and case blocks are closed like this: if some-expr then echo "hello world" fi case $some-var in [1-5]) do-a-thing ;; *) do-another-thing esac as opposed to the ...
8
votes
5answers
3k 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 ...
5
votes
6answers
816 views

PHP as a scripting language

I have reasonable knowledge of PHP, Perl, and Bash. I use Perl for most text processing on my system (find, replace, filter output, etc). I use PHP for web development, allowing a user to view and ...
4
votes
2answers
4k views

I need to know the reasons why learning Linux Shell Scripting (BASH) benefits me as a PHP developer [closed]

I have been developing web sites/applications using the LAMP stack for almost 5 years. Currently I am interested to dig more into Linux OS, specifically BASH but from a web developer perspective, not ...
5
votes
5answers
3k views

Trailing forward slash in directory names - good programming practice?

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 - to require that the user enter a trailing / (forward slash) ...
33
votes
16answers
21k views

Why such popularity with Python? [closed]

Other than being annoyed at whitespace as syntax, I'm not a hater, I just don't get the fascination with Python. I appreciate the poetry of Perl, and have programmed beautiful web services in bash ...