Giter VIP home page Giter VIP logo

bash-lib's People

Contributors

aks avatar rico-chet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bash-lib's Issues

make doesn't work

I cloned the repo, then tried to run make as described in the install instructions.

  ass-vm  vagrant   master  ~  bash-lib  make
generate-prompt-colors
make: /usr/local/bin/bash: Command not found
Makefile:38: recipe for target 'prompt-colors.sh' failed
make: *** [prompt-colors.sh] Error 127

add list_indexof

could not find this function in list-utils.sh

function array_indexof() {
  [ $# -lt 2 ] && return 1
  local a=("$@")
  local v="${a[-1]}"
  unset a[-1]
  local i
  for i in ${!a[@]}; do
    if [ "${a[$i]}" = "$v" ]; then
      echo $i
      return 0 # stop after first match
    fi
  done
  return 1
}

a=(1 2 3 4)
i=$(array_indexof "${a[@]}" 3)
echo $i # 2

also posted on https://stackoverflow.com/a/70793702/10440128

similar:

// javascript
[1,2,3,4].indexOf(3) == 2
# python
[1,2,3,4].index(3) == 2

Many test failures

After one sorts out the installation troubles, many tests are failing: replit. This doesn't seem to just affect artificial scenarios, but for instance split_into() fails miserably on my first try by not finding the __split_str() function (which doesn't seem to exist).

Add license file

Can you add a license file? I am interested in this repository.

add_list somelist "A string with $var" causes the $var to be eval'ed

It should be possible to add a string to a list without having the string evaluated.

There may be some use cases where the string should be eval'ed, but the default should be "as-is".

If someone really wants the string to be eval'ed before adding, just do this:

add_list somelist `eval "some string with $var"`

make fails when the current directory is not in $PATH

Hi,

I tried to build and install the library and make failed because of the below call to generate-prompt-colors. After making the below change make worked fine.

diff --git a/Makefile b/Makefile
index 0fd0e5b..9518f7b 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ libs = 	\
 	# end of list
 
 prompt-colors.sh: generate-prompt-colors
-	generate-prompt-colors
+	./generate-prompt-colors
 
 clean::
 	rm -f prompt-colors.sh*

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.