baslinux AT lists.ibiblio.org
Subject: Baslinux mailing list
List archive
[BL] Simple File Manager (was: DOS & Shell Scripting Guide)
- From: Lee Forrest <lforrestster AT gmail.com>
- To: baslinux AT lists.ibiblio.org
- Subject: [BL] Simple File Manager (was: DOS & Shell Scripting Guide)
- Date: Fri, 2 Feb 2007 20:23:12 +0000
On Sat, Feb 03, 2007 at 03:54:02PM +1300, 3aoo-cvfd AT dea.spamcon.org wrote:
> Lee Forrest wrote:
> >
> > Do you know how to turn that mess into, say, 4 neat columns,
> > with printf? I'd love to be able to do that.
>
> clear
> num=1
> set "/" "/bin" "/dev" "/etc" "/home" "/lib" "/proc" "/root" "/sbin" "/usr"
> "/var" ".." `/bin/ls -F`
> for file in "$@" ; do
> printf "%-20s" "[${num}] $file"
> [ `dc $num 4 mod` = 0 ] && echo
> num=`expr $num + 1`
> done
I've heard of dc (used bc on my debian at a very basic level) and
know it is a similar app, but didn't even know I had it here on
BL3 (hangs head in shame).
I tested the above and got results like this:
[5] /home [: 0: unknown operand
[6] /lib [: 0: unknown operand
[7] /proc [: 0: unknown operand
[8] /root [: 0: unknown operand
[9] /sbin [: 0: unknown operand
[10] /usr [: 0: unknown operand
[11] /var [: 0: unknown operand
That's a test error, right?
I tried using "-eq" instead of "=" and "''" instead of "0", and
N=`dc $num 4 mod`
[ $N = 0 ] && echo
Got the same error with "-eq" and this below with "''":
[: unknown operand
dc $num 4 mod
on the commandline yields _no_ output, regardless of the number I substitute
for $num. It just returns the prompt.
I've got the dc manpage from the web, and am looking it over now.
What am I missing, Steven?
Lee
--
BasicLinux: Small is Beautiful
http://www.basiclinux.com.ru
-
Re: [BL] long filenames 34
, (continued)
-
Re: [BL] long filenames 34,
James Miller, 02/01/2007
- [BL] Shell Collection (was long filenames) 3D, Lee Forrest, 02/01/2007
-
Re: [BL] long filenames 34,
Greg Mayman, 02/01/2007
-
Re: [BL] long filenames 34,
3aoo-cvfd, 02/01/2007
-
[BL] DOS & Shell Scripting Guide (was: long file names) 3C,
Lee Forrest, 02/01/2007
- Re: [BL] DOS & Shell Scripting Guide (was: long file names) 3C, Karolis Lyvens, 02/02/2007
-
Re: [BL] DOS & Shell Scripting Guide (was: long file names) 3C,
Ron Clarke, 02/02/2007
-
Re: [BL] DOS & Shell Scripting Guide 40,
Lee Forrest, 02/02/2007
-
Message not available
- Re: [BL] DOS & Shell Scripting Guide 41, Lee Forrest, 02/02/2007
- Re: [BL] DOS & Shell Scripting Guide 41, 3aoo-cvfd, 02/02/2007
- [BL] Simple File Manager (was: DOS & Shell Scripting Guide), Lee Forrest, 02/02/2007
- Message not available
- Re: [BL] Simple File Manager 42, Lee Forrest, 02/03/2007
- Re: [BL] Simple File Manager (was: DOS & Shell Scripting Guide), 3aoo-cvfd, 02/03/2007
- Re: [BL] Simple File Manager 44, Lee Forrest, 02/03/2007
- Message not available
- Re: [BL] Simple File Manager 45, Lee Forrest, 02/03/2007
- Re: [BL] Simple File Manager, 3aoo-cvfd, 02/03/2007
- Re: [BL] Simple File Manager 46, Lee Forrest, 02/03/2007
-
Message not available
-
Re: [BL] DOS & Shell Scripting Guide 40,
Lee Forrest, 02/02/2007
-
[BL] DOS & Shell Scripting Guide (was: long file names) 3C,
Lee Forrest, 02/01/2007
-
Re: [BL] long filenames 34,
3aoo-cvfd, 02/01/2007
-
Re: [BL] long filenames 34,
James Miller, 02/01/2007
Archive powered by MHonArc 2.6.24.