Print count of terminal coderinme

Print count of terminal coderinme

Now the problem we will now work upon is to Print count of terminal coderinme
So print count of terminal, if UID logname is given.
But before that we should know what a terminal is.

First of all what is a terminal?

A terminal is a device that enables the users to communicate with a computer…..
Intelligent terminal is a stand alone device that contains the main memory and also a CPU….
In networking, we say a terminal is a personal computer or a workstation connected to a mainframe.

NOW LET’S CODE TO COUNT

#!/bin/bash
read -p "Enter the LOGNAME or UID: " name
ch=`who | cut -d " " -f1 | grep "$name" | wc -w`
echo "Number of shells currently in use by $name are: "$ch

Output:

Print count of terminal coderinme

for more Linux questiom

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

A web developer(Front end and Back end), and DBA at csdamu.com. Currently working as Salesforce Developer @ Tech Matrix IT Consulting Private Limited. Check me @about.me/s.saifi

Leave a reply:

Your email address will not be published.