How to get specific results from 'free -m' ?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#41 Post by musher0 »

MochiMoppel wrote:
ITSMERSH wrote:Though, strange code! :lol: :wink:
You haven't seen strange code yet. Try this:

Code: Select all

#!/bin/bash
[[ $(< /proc/uptime) =~ [0-9]* ]]
echo "Uptime $((BASH_REMATCH/86400)) days $((BASH_REMATCH%86400/3600)) hrs  $((BASH_REMATCH%3600/60)) min"
Source. ;)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#42 Post by MochiMoppel »


musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#43 Post by musher0 »

MochiMoppel wrote:Source :!:
:lol:
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

some1
Posts: 117
Joined: Thu 17 Jan 2013, 11:07

#44 Post by some1 »

musher0 wrote:
MochiMoppel wrote:
ITSMERSH wrote:Though, strange code! :lol: :wink:
You haven't seen strange code yet. Try this:

Code: Select all

#!/bin/bash
[[ $(< /proc/uptime) =~ [0-9]* ]]
echo "Uptime $((BASH_REMATCH/86400)) days $((BASH_REMATCH%86400/3600)) hrs  $((BASH_REMATCH%3600/60)) min"
Source. ;)
MochiMoppel wrote:Source :!:
musher0 wrote:
MochiMoppel wrote:Source :!:
:lol:

musher0:Why :?: :?: :?: :?:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#45 Post by musher0 »

Hi, some1.

"Why" what? Please get off your high horse.

Because that is my way of saying to everyone on this forum that this kind
of learning is fun.

Tipped off by a hint from a benevolent fellow "student" (RSH, not to name
him!), I find on the Web a source specifically for MochiMoppei's trick --
because he did not provide one --, and he replies referring me to the
entire "Book of Bash"!

There is humor in this. At least I can see it.

It is well proven that one learns better when one is in a relaxed, even
humorous, mood. If that angers the "teachers" on this forum... well, what
can I say? You guys go follow a course in Learning Modes at your local
Faculty of Education?

Although inactive ATM, I hold a valid Teacher's Certificate, you know, so
I know a thing or two about that. Another thing you have to know about
me: I truly despise "teachers" who base their teaching only on
haughtiness and authority.

(Edit, 10 min. later:)
... but maybe you belong to a culture where it is ok for teachers to base
their teaching on haughtiness and authority. In my culture, it is not, not
anymore.
(end of edit)


Put down a "student" for what he does not know, and you create a rebel,
perhaps an enemy. Prove that your teaching is based on your skills,
provide good sources, explain instead of commanding, display a friendly
attitude towards your student, and this student will become an admirer.

(Edit, 5 min. later:)
-- teach from the known to the unknown. On a forum like this, it is not
obvious, but try to deduce or find out in some way or other at which level
the student is.

If there are too many steps between what the student knows and the
target knowledge, the student won't learn anything. He'll send you to hell
because of the difficulty.

-- teach from context, teach from the problem. Although not ideal
because it creates "spotty knowledge", it is better than nothing, and it is
very useful in problem-solving.

It is also a very popular mode of learning on forums like this one, and
with people who find the "cram-your-brain" approach disgusting.

On the bright side, if this is done enough times, these "spots" of
knowledge will eventually merge into a full knowledge of the subject.

-- foster good Web and library research techniques. If the student cannot
learn from you because you displayed, e.g., the unsavory side of your
personality in your last lesson ;), he can probably learn from his research.
(end of edit)


As a result -- and this is no doubt the most important, incredible and
amazing thing -- : the student will learn!

In conclusion --
Food for thought, I hope. But who am I to "teach a teacher", eh?

Respectfully submitted.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply