I am new to bash, and I am creating a script that loops through the files in a directory and based on part of the filename, does something with the file, so far I have this:
#!/bin/bash DIR="/Users/me/Documents/import/*" for f in "$DIR" do t=?????? echo "Loading $f into $t..." done
$f will output something like this:
/Users/me/Documents/import/time_dim-1272037430173 out of this, I want
t to equal
time_dim, the directory can be variable length and
-1272037430173 is a fixed length (it's the unix timestamp btw).
What is the best way to go about this?