I'm pretty unfamiliar with bash syntax and I'm running into a problem of how to use strings from a previous operation as inputs into subsequent ones. Here's what I have now:
#!/bin/bash
searchTerm=$1
results=$(npm search $searchTerm --json | jq '.[].name')
for term in $results
do
info=$(npm info $term)
echo "####" $info
done
The command that executes looks like the following and fails:
npm info "\"exampleTerm\""
How do I use $term in the for loop in combination with npm info?
npm search $searchTerm --json | jq '.[].name'look like?