I'm trying to make a script that will find all symlinks in a directory that the script is currently in, and it will echo "This 'link' refers to 'path' and it's owner is 'owner'.
I've come up with this solution so far, but it doesn't work for some reason.
Here's my code:
#!/bin/bash
for each in .
do
echo "Link '$1' refers to" $(realpath $1) "and its owner is: " $(ls -ld $(realpath $1) | awk '{print $3}')
end for
And this it the error that it gives me:
jakub.kacerek@perun:~$ ./najdi_symlink.sh
./najdi_symlink.sh: line 7: syntax error: unexpected end of file
jakub.kacerek@perun:~$
I'm 100% sure that the error is in the for loop, but I don't know how to solve it.