I'm trying to iterate through a list of folder names, and perform some operations on the name, but whatever I try to do inside the while loop, results in a "Command not found".
For example, the following code:
#!/bin/bash
C=$(echo "ABCDEF" | cut -c1)
R=$(echo "ABCDEF" | sed "s/A/X/g")
echo $C
echo $R
for PATH in $(find . -maxdepth 1 -type d); do
C=$(echo $PATH | cut -c1)
R=$(echo $PATH | sed "s/A/X/g")
echo $C
done
Outputs:
A
XBCDEF
line 9: cut: command not found
line 10: sed: command not found