intracom-telecom-sdn/nstat

View on GitHub
emulators/nbemu/clean.sh

Summary

Maintainability
Test Coverage

Showing 9 of 9 total issues

Double quote to prevent globbing and word splitting.
Open

for item in $( ls -1 $SCRIPT_DIR ); do
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Double quote to prevent globbing and word splitting.
Open

echo $SCRIPT_DIR
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Double quote to prevent globbing and word splitting.
Open

rm -rf $SCRIPT_DIR/$item
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Use "${var:?}" to ensure this never expands to / .
Open

rm -rf $SCRIPT_DIR/$item
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Double quote to prevent globbing and word splitting.
Open

if [ $item != 'build.sh' ] && [ $item != 'clean.sh' ]; then
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Double quote to prevent globbing and word splitting.
Open

if [ $item != 'build.sh' ] && [ $item != 'clean.sh' ]; then
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Double quote to prevent globbing and word splitting.
Open

rm -rf $SCRIPT_DIR/$item
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Iterating over ls output is fragile. Use globs.
Open

for item in $( ls -1 $SCRIPT_DIR ); do
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Open

if [ $? -ne 0 ]; then
Severity: Minor
Found in emulators/nbemu/clean.sh by shellcheck
Category
Status