SUMMARY: non-interactive newfs

From: Christopher L. Barnard <>
Date: Tue Feb 11 2003 - 16:04:28 EST
I asked:

> I want to have a newfs done from cron.  However, from reading the man 
> page and trying different options, it appears that newfs always requires
> user input.  Has anyone successfully done a newfs (or mkfs I guess) on
> a unix file system without a user prompt?

The answer:

echo y | /usr/sbin/newfs /dev/dsk/cXdXtXsX

Some people also suggested using the Gnu binary "yes".  Others pointed
out that newfs will not send interactive questions if there is no tty.
Some other people talked about using expect, but I was hoping that I
wouldn't have to do something that complicated.  Some folks use mkfs, the
underlying command that newfs calls.  And finally, some folks questioned
the sanity of wanting a newfs in cron.  ;^)

Thanks to:
Marty Davis <>
Kevin Korb <>
Sean Berry <>
Adam Ronthal <>
Steve Maher <>
"Broun, Bevan" <>
Dave Lowenstein <>
"Thomas M. Payerle" <>
Espen Martinsen <>
"Hsu, Cheng (Consultant)" <>
Kevin Buterbaugh <>
Justin Stringfellow <js70062@ms-egmp02-01.UK.Sun.COM>
Rierson Robert Civ OC-ALC/MASLA <>

| Christopher L. Barnard         O     When I was a boy I was told that |
|         / \    anybody could become president.  |
| (312) 347-4901               O---O   Now I'm beginning to believe it. |
|                --Clarence Darrow |
+----------PGP public key available via finger or PGP keyserver---------+
sunmanagers mailing list
Received on Tue Feb 11 16:09:17 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:03 EST