WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: problem with awk in autoscan  (Read 2410 times)

Offline dalazyman

  • Newbie
  • *
  • Posts: 2
problem with awk in autoscan
« on: June 03, 2010, 07:13:55 AM »
Hi there,

I think I found a bug within etc/init.d/tc_functions. On startup, I used bootlocal.sh to execute some mounts. This worked well until TC 2.7 ... recently I upgraded to 2.11 and all my mounts were gone. So I looked for the problem and after a lot of headaches I found out that the awk expression in the autoscan() function needs to be updated in order to work properly.

Here's a helpful link:
http://www.gnu.org/manual/gawk/html_node/Field-Separators.html#Field-Separators

So, instead of

" `grep "/mnt/" /etc/fstab | grep -vf /etc/init.d/tc_noscan.lst | awk 'FS="/" {print $3}'` "

it should be modified to:

" `grep "/mnt/" /etc/fstab | grep -vf /etc/init.d/tc_noscan.lst | awk 'BEGIN {FS="/"}; {print $3}'` "

That worked for me and now all mounts are available after boot.

Kind regards.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: problem with awk in autoscan
« Reply #1 on: June 03, 2010, 03:22:46 PM »
Agreed. Updated. Thanks.
10+ Years Contributing to Linux Open Source Projects.