summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 87862c19b..2ae11bf8e 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -41,7 +41,8 @@ sub lsmod { print "Module Size Used by\n"; cat("/proc/modules"
sub grep_ {
my ($h, $v) = getopts(\@_, qw(hv));
- my $r = shift and !$h or die "usage: grep <regexp> [files...]\n";
+ @_ == 0 || $h and die "usage: grep <regexp> [files...]\n";
+ my $r = shift;
@ARGV = @_; (/$r/ ? $v || print : $v && print) while <>
}
@@ -57,13 +58,17 @@ sub tr_ {
sub mount {
@_ or return cat("/proc/mounts");
my ($t) = getopts(\@_, qw(t));
- my $fs = $t ? shift : $_[0] =~ /:/ ? "nfs" : "ext2";
+ my $fs = $t && shift;
@_ == 2 or die "usage: mount [-t <fs>] <device> <dir>\n",
" (if /dev/ is left off the device name, a temporary node will be created)\n";
+ my ($dev, $where) = @_;
+ $fs ||= $where =~ /:/ ? "nfs" :
+ $dev =~ /fd/ ? "vfat" : "ext2";
+
require 'fs.pm';
- fs::mount(@_, $fs, 0, 1);
+ fs::mount($dev, $where, $fs, 0, 1);
}
sub umount {