Reputation: 12094
This works:
#!/bin/bash
while read system_name mount_name
do
echo "${system_name} ${mount_name}"
done < <(echo "select system_name, mount_name from SystemTable" | mysql ifm -uroot -pinsite3)
But this does not if i change the shebang variable to #!/bin/sh How to make the above script work in sh shell?
Upvotes: 1
Views: 291
Reputation: 31087
Perhaps:
#!/bin/sh
echo "select system_name, mount_name from SystemTable" | mysql ifm -uroot -pinsite3 |
while read system_name mount_name
do
echo "${system_name} ${mount_name}"
done
Upvotes: 2