I did a find command to search for files and stored it in a variable. I then will use the variable to get the file name and "get" it from another server (using ftp). The problem I have is, filenames are stored with "./" in the variable. when I try to get it, I get an error because "./" does not work in the other server i.e. windows NT.
How do I just extract the filename without the "./" as stored in the variables.
Example :
Contents of FILES variable
./test.txt ./process.txt ./order.txt
basename is a external command like sed. However:
RESULT=`basename $VARIABLE`
is the syntax. With modern shells, you can use builtins to do this:
x=${x#./}
No putting in the star would not be the same. Sometimes the braces are required like in this example. Braces will never hurt. I don't use braces unless I have a reason. See our faq section for book suggestions.