If you don't get the expected result, it means the code has a problem (maybe not in syntax, but still!)
---------- Post updated at 04:12 PM ---------- Previous update was at 04:09 PM ----------
1) Use double quoting
2) For troubleshooting maybe you can echo the used values before doing the move :
instead of
then give a test run and see if the output gives some clue
How do I remove a directory named: $HOME
$ rm "$HOME"
rm: $HOME is a directory
$ rmdir "$HOME"
rmdir: directory "/home/bob": Directory is a mount point or in use (4 Replies)
Hello all,
Most of our users have the same home directory, I know it's weird but it has been like this before me and we don't want to change that for now. When creating a new user using command useradd, it is not allowing me to create it because it is using the home directory of someone else. I... (2 Replies)
I am little bit confused when the words "root directory" and "home directory" and "parent directory" are used. Can anybody explains the difference.
I am trying to list the names and protections levels and size of visible files in the root directory
would it be correct if I just typed:
ls... (2 Replies)
I created a new user and assigned a certain home dir to tis user. I've noticed that this home dir (/export/home/test) is already assigned to other users. I really want to create a dedicated home dir for the new user. Can anyone tell me how I can modify this user with a new homedir?
Thx for... (4 Replies)
Hello,
i need to create a user who's access is restricted only to his home directory and below,
i restricted his pty access by adding 'no-pty' to the options of the ssh key in authorized_keys file. However, sftp access still allows this user access to all my file system
thanks (5 Replies)
Hi,
I want suggestion about user home directories, checking. how i could calculate this. I have 200 Users.
if home-dir-of-user1 > 250 MB -> print "OK"
fi
if home-dir-of-user1 > 500 MB > Print "Warning"
fi
if home-dir-of-user1 > 1000 MB > Print "Critical"
fi
Thanks,
Bash (4 Replies)
Hi all,
I have to mount my home directory in one box, by default everyone's home directory will mount in all unix boxes which we have. But we have unmounted these home directories from some boxes to keep the data as safe. So for automation purpose i need my home directory only in those boxes to... (2 Replies)
Hi all
i am using solaris 10, i am creating user with
useradd -d/home/user -m -s /bin/sh user
user is created with in the following path
/export/home/user (auto mount)
i need the user to be created like this
(/home as default home directory )
useradd -d /home/user -m -s /bin/sh... (2 Replies)
Hi
i am new to this admin area .
i have created user with name as "ab" and gave home dir as /home/ab .
when i tried to create the /home/ab dir , i got he following error.
"mkdir: Failed to make directory "/home/ab"; Operation not applicable
"
Thanks in advance . (1 Reply)
Hi Team,
I'm new to Unix shell scripting .
I've the following requirement
A folder contains the list of files with the following format
ab.name.11.first
ab.name.12.second
ab.name.13.third
----------
I have to rename the above file to like below
... (6 Replies)
Discussion started by: smile689
6 Replies
LEARN ABOUT DEBIAN
mongodb::oid
MongoDB::OID(3pm) User Contributed Perl Documentation MongoDB::OID(3pm)NAME
MongoDB::OID - A Mongo ObjectId
SYNOPSIS
If no "_id" field is provided when a document is inserted into the database, an "_id" field will be added with a new "MongoDB::OID" as its
value.
my $id = $collection->insert({'name' => 'Alice', age => 20});
$id will be a "MongoDB::OID" that can be used to retreive or update the saved document:
$collection->update({_id => $id}, {'age' => {'$inc' => 1}});
# now Alice is 21
To create a copy of an existing OID, you must set the value attribute in the constructor. For example:
my $id1 = MongoDB::OID->new;
my $id2 = MongoDB::OID->new(value => $id1->value);
Now $id1 and $id2 will have the same value.
Warning: at the moment, OID generation is not thread safe.
SEE ALSO
Core documentation on object ids: <http://dochub.mongodb.org/core/objectids>.
ATTRIBUTES
value
The OID value. A random value will be generated if none exists already. It is a 24-character hexidecimal string (12 bytes).
Its string representation is the 24-character string.
METHODS
to_string
my $hex = $oid->to_string;
Gets the value of this OID as a 24-digit hexidecimal string.
get_time
my $date = DateTime->from_epoch(epoch => $id->get_time);
Each OID contains a 4 bytes timestamp from when it was created. This method extracts the timestamp.
TO_JSON
my $json = JSON->new;
$json->allow_blessed;
$json->convert_blessed;
$json->encode(MongoDB::OID->new);
Returns a JSON string for this OID. This is compatible with the strict JSON representation used by MongoDB, that is, an OID with the value
"012345678901234567890123" will be represented as "{"$oid" : "012345678901234567890123"}".
AUTHOR
Kristina Chodorow <kristina@mongodb.org>
perl v5.14.2 2011-09-07 MongoDB::OID(3pm)