Dumb Bash Script question

Dazed_75 lthielster at gmail.com
Wed May 25 20:57:07 MST 2011


In a bash script, how can I set the contents of a variable to the result of:

mount | grep tftpboot | wc | cut -c 5-8

In case more info would help, the current script is

#! /bin/bash
#
# count the number of mounts in /tftpboot/iso/ each minute
# ^C to end
while :
do
  ans=$(( 12 ))
  date +"%A %H:%2M   # .ISOs loop mounted= $ans"
  mount | grep tftpboot | wc | cut -c 5-8
  sleep 60
done

which puts the count of files mounted on a separate line.  If I could make
$ans contain the result it cane be printed by the date command in the same
line.

-- 
Dazed_75 a.k.a. Larry

The spirit of resistance to government is so valuable on certain occasions,
that I wish it always to be kept alive.
  - Thomas Jefferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20110525/98bd18a0/attachment.html>


More information about the PLUG-discuss mailing list