Make script drastically faster substituting external commands by bash builtins