Hey all,
How do I execute a file at startup automatically.
From what I've read is that I need to put it into my .bashrc file. I'm not sure where to go from there. Can I just type commands into that and they'll run next time I restart my server?
Right now I have added these lines:
cd... (2 Replies)
Hello,
I've been trying to run 'ls -1R | wc -l' inside of sub directories to in order to determine how big each folder is.
find . -maxdepth 1 -type d | while read folder
do
cd "$folder" &&
echo "$folder has $(ls -1R | wc -l) files" &&
cd ..
done
or
for... (3 Replies)
Basically what i'm trying to do is execute an update command and at the same time have the system do a TCPdump to file for that update traffic.
So I would like to connect the two commands so that the tcpdump terminates automatically when the update finishes/fails/whatever.
Right now I have... (0 Replies)
Hi,
Couldnt find the right string" to search for a similar question..so dont know if this has been answered yet...problem is that I want to prepare a command with the requisite parameters passed as a string before executing it...eg: the ls command ..
I can pass "-l", "-t" as parameters and... (12 Replies)
Hi,
I am executing below script
s1=`pwd`
s2=/space
if
then
echo "done"
else
echo "mistake"
cd /tmp
fi
I am not able to migrate to /tmp directory if the condition is not true.However mistake is being printed.Means cd command is not working here.All other commands except cd are... (3 Replies)
Hi. We can have one or more agents of a particular type running on our AIX and Solaris servers. As these agents have usually been installed into their own filesystems, I need to capture the filesystem names for auditing purposes. I've had a search through the forums can see something that fits the... (16 Replies)
Hi,
I have 2 files temp1.sh and temp2.sh as follows:
===========
temp1.sh
===========
echo "session1"
sh temp2.sh
echo "exit session2 and enter session1"
=================================
=============
temp2.sh
=============
echo "session2"
sh
echo "exit session2"... (5 Replies)
Hi,
I have this command in a shell script and I can get it to echo ok, but when I try to execute the command I get a "file not found" error. Which is strange because, if I copy and paste the same command at the cli it works ok.
What am I doing wrong please? (16 Replies)
I'm running CentOS 6.8 and use bash. I would like a warning to appear to the user who runs the command "service httpd restart"
E.g.
# service httpd restart
are you sure y/n
n
#
(or if y, the command executes).
I looked into it a little but am not sure of the best approach. Aliases I ... (1 Reply)
I'm running CentOS 6.8 and use bash. I would like a warning to appear to the user who runs the command "service httpd restart"
E.g.
# service httpd restart
are you sure y/n
n
#
(or if y, the command executes).
I looked into it a little but am not sure of the best approach. Aliases I... (2 Replies)
Discussion started by: spacegoose
2 Replies
LEARN ABOUT DEBIAN
mouse::role
Mouse::Role(3pm) User Contributed Perl Documentation Mouse::Role(3pm)NAME
Mouse::Role - The Mouse Role
VERSION
This document describes Mouse version 0.99
SYNOPSIS
package Comparable;
use Mouse::Role; # the package is now a Mouse role
# Declare methods that are required by this role
requires qw(compare);
# Define methods this role provides
sub equals {
my($self, $other) = @_;
return $self->compare($other) == 0;
}
# and later
package MyObject;
use Mouse;
with qw(Comparable); # Now MyObject can equals()
sub compare {
# ...
}
my $foo = MyObject->new();
my $bar = MyObject->new();
$obj->equals($bar); # yes, it is comparable
DESCRIPTION
This module declares the caller class to be a Mouse role.
The concept of roles is documented in Moose::Manual::Roles. This document serves as API documentation.
EXPORTED FUNCTIONS
Mouse::Role supports all of the functions that Mouse exports, but differs slightly in how some items are handled (see "CAVEATS" below for
details).
Mouse::Role also offers two role-specific keywords:
"requires(@method_names)"
Roles can require that certain methods are implemented by any class which "does" the role.
Note that attribute accessors also count as methods for the purposes of satisfying the requirements of a role.
"excludes(@role_names)"
This is exported but not implemented in Mouse.
IMPORT AND UNIMPORT
import
Importing Mouse::Role will give you sugar. "-traits" are also supported.
unimport
Please unimport ("no Mouse::Role") so that if someone calls one of the keywords (such as "has") it will break loudly instead breaking
subtly.
CAVEATS
Role support has only a few caveats:
o Roles cannot use the "extends" keyword; it will throw an exception for now. The same is true of the "augment" and "inner" keywords
(not sure those really make sense for roles). All other Mouse keywords will be deferred so that they can be applied to the consuming
class.
o Role composition does its best to not be order-sensitive when it comes to conflict resolution and requirements detection. However, it
is order-sensitive when it comes to method modifiers. All before/around/after modifiers are included whenever a role is composed into a
class, and then applied in the order in which the roles are used. This also means that there is no conflict for before/around/after
modifiers.
In most cases, this will be a non-issue; however, it is something to keep in mind when using method modifiers in a role. You should
never assume any ordering.
SEE ALSO
Mouse
Moose::Role
Moose::Manual::Roles
Moose::Spec::Role
perl v5.14.2 2012-06-30 Mouse::Role(3pm)