I read this post, but I cannot figure out how to make what I need.
I have a variable, which is a path, so I would like to have the name of the file (last column if I separate by /).
So I tried several combinations, such as:
#!/bin/sh
source=$1
target=$2
for i in "$source"/*
do
$name = awk -F/ -v '{ print $NF }' $i
echo $name
done
But no success, could anybody help me?? Thanks in advance
you can just use the shell to extract the file names without external tools