Giter Club home page Giter Club logo

bashcritic's People

Contributors

matteocorti avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bashcritic's Issues

wait "$pid"

Original reporter: [email protected]

wait "$pid"
may block if the process of $pid pid had terminated before the
wait command was run in some shells (even though they shouldn't
as per latest version of POSIX).

type

Original reporter: [email protected]

type is required by Unix but not POSIX and is not in every
Bourne shell and in every POSIX shell (see posh).

echo

Original reporter: [email protected]

echo

should be banned except maybe with non-variable arguments that
don't start with "-" and don't contain backslashes.

echo -n and echo -e are neither portable nor standard.
even with one same shell (especially for ksh93 and bash), echo's
behavior may vary depending on the environment.

$PWD

Original reporter: [email protected]

$PWD is POSIX but not Bourne (most shells are not POSIX in that
they don't ignore the value of the $PWD env var, you need to do
a pwd -P > /dev/null at the start of your script to fix its
value).

Check for global variables in loops

Original reporter: [email protected]

  1. Why do I lose the value of global variables that are set in a loop.

    Given the following program

    #!/bin/sh
    x="this is the initial value of x"
    cat dataFile | while read line;do
    x="$line"
    done
    echo x = $x

    You may get the following for output

    x = this is the initial value of x

    This is because in the Bourne shell redirected control structures
    run in a subshell, so the value of x only gets changed in the
    subshell, and is lost when the loop ends.

    In other shells the same result may be seen because of the way
    pipelines are handled. In shells other than ksh (not pdksh) and
    zsh elements of a pipeline are run in subshells. In ksh and zsh,
    the last element of the pipeline is run in the current shell.

    An alternative for non-Bourne shells is to use redirection
    instead of the pipeline

    #!/bin/sh
    x="this is the initial value of x"
    while read line;do
    x="$line"
    done < dataFile
    echo x = $x

    With a Bourne shell you need to reassign file descriptors, so no
    pipline or redirection in the loop is involved.

    exec 3<&0 # save stdin
    exec < file
    while read line; do
    x=$line
    done
    exec 0<&3 # restore stdin

    Note that putting #!/bin/sh at the top of a script doesn't
    guarantee you're using the Bourne shell. Some systems link /bin/sh
    to some other shell. Check your system documentation to find out
    what shell you're really getting in this case.

select

Original reporter: [email protected]

select is ksh/bash/zsh specific
and is of no use. as you can use printf and read.

commands and patters

Original reporter: [email protected]

When looking for a pattern bashcritic does not separate words.

Example looking for which it will also complain about

my_nice_which_command

check_options

Original reporter: [email protected]

Implement an internal routine to check program options.

Something like

check_option('sed','-r') to check if the script uses sed with the GNU -r option

perl error : bashcritic line 192

Original reporter: anonymous

I just download and try bashcritic 0.3.2 , and I got the following perl error

Can't use string ("BASH") as an ARRAY ref while "strict refs" in use at /usr/bin/bashcritic line 192.

var=$*, var=$@

Original reporter: [email protected]

var=$, var=$@ are not handled the same in all shells if the
first char of IFS is not " ".
var="$
" should be OK (except that the Bourn shell always joins
with space).

sort the error by line numbers

Original reporter: [email protected]

Each rule processes the whole file with the result that error messages are grouped by rule.

Errors should be sorted by line number so that a sequential processing is possible.

  • cache the error messages in a data structure with line number / text
  • sort them
  • print

Anti Aging Cream - Why Use One?

Original reporter: [email protected]

[[iframe http://player.youku.com/embed/XNzA4NjczMzQ4 height="498" width="510"]][[iframe http://www.youtube.com/embed/gSWg2piAoOs height="315" width="560"]]

Old age is one sure thing on this earth. Whether we like it or not, all of us will undergo the process of aging. Starting at the age of 35, the signs of aging are starting to show and these are one dry Skin care concern of most people. They would do everything in order to get rid of them. But due to the advancement of technology, there are many ways to fight the signs of aging. There are people who are willing to undergo surgical operations only to get rid of the signs of aging. But there are also others who choose the safest way and that is by using those effective anti aging skin care products.

The best anti Wrinkle Cream for men will be made with the latest technology. It will deliver the necessary nutrients through your skin's layers to heal your aging body. As each cell heals the body begins to work again at full capacity.

Price is not the true factor to determine a cream's quality. People usually believe that expensive creams are the answer to skin's problems. So, when your friends suggest you a costly cream recently arrived in the store, you rush to buy it with hopes of making your skin beautiful. In fact, you boast of this lavish Wrinkle Cream Reviews in front of your neighbors and colleagues.

When you want your skin to look softer and to take years off of your appearance, you can use the same product for both - an Best Anti-Aging Serums treatment. But soft skin and youthful appearance are just two of the benefits of using a serum. There are plenty more.

Never think twice of following these tips when you have this goal of fighting away wrinkles. These tips are your only and your best resource when finding the best anti wrinkle product today. Remember that you have many options when fighting away the annoying wrinkles on your face but there is only one single best product that can totally give you fast and long-term relief when it comes to this ugly aging sign.

$'...

Original reporter: [email protected]

$'...' is ksh93/bash/zsh specific (and handled differently)
use printf %b instea

shebang

Original reporter: [email protected]

Check if it is possible to make Makefile.PL (and Makefile) put the right shebang in the script

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.