Skip to main content
added 120 characters in body
Source Link
Madden
  • 345
  • 1
  • 2
  • 7

I have this script

tests=()
igrepy -l $1 . | while read -r line
do
    // some processing
    tests+=("${second[0]}")
done
echo ${tests[@]}

I've checked that 'second' has a result and it does, however my echo returns a blank string. What has gone wrong here? This is on rhel6, 'igrepy' is an alias to a case insensitive grep that only search python files

I have this script

tests=()
do
    // some processing
    tests+=("${second[0]}")
done
echo ${tests[@]}

I've checked that 'second' has a result and it does, however my echo returns a blank string. What has gone wrong here? This is on rhel6

I have this script

tests=()
igrepy -l $1 . | while read -r line
do
    // some processing
    tests+=("${second[0]}")
done
echo ${tests[@]}

I've checked that 'second' has a result and it does, however my echo returns a blank string. What has gone wrong here? This is on rhel6, 'igrepy' is an alias to a case insensitive grep that only search python files

Source Link
Madden
  • 345
  • 1
  • 2
  • 7

Adding to arrays

I have this script

tests=()
do
    // some processing
    tests+=("${second[0]}")
done
echo ${tests[@]}

I've checked that 'second' has a result and it does, however my echo returns a blank string. What has gone wrong here? This is on rhel6