[LUNI] Shell script question.

Kristian Erik Hermansen kristian.hermansen at gmail.com
Mon Jan 28 11:33:46 CST 2008


On Jan 28, 2008 10:43 AM, Richard Reina <richard at rushlogistics.com> wrote:
> I've been playing around with inotify but my shell scripting
> ignorance is getting in the way.
>
> ${file} is getting written with a dot "." and a wacky suffix like
> ".yfEVx1" which causes the script to crash at line 5 with:
>
> cat .new_file.yfEVx1: no such file or directory.  How can I capture the
> true file name as it appears (new_file) so that cat will work?
>
> Pardon my ignorance.  Any help would be greatly appreciated.

Pass your "wacky" file name through this filter...

cut -d '.' -f 2

Watch...
$ echo -en '.new_file.yfEVx1' | cut -d '.' -f 2
new_file
-- 
Kristian Erik Hermansen
"Know something about everything and everything about something."


More information about the luni mailing list