Sunday, 8 Feb 2026
Subscribe
logo
  • Global
  • AI
  • Cloud Computing
  • Edge Computing
  • Security
  • Investment
  • Sustainability
  • More
    • Colocation
    • Quantum Computing
    • Regulation & Policy
    • Infrastructure
    • Power & Cooling
    • Design
    • Innovations
    • Blog
Font ResizerAa
Data Center NewsData Center News
Search
  • Global
  • AI
  • Cloud Computing
  • Edge Computing
  • Security
  • Investment
  • Sustainability
  • More
    • Colocation
    • Quantum Computing
    • Regulation & Policy
    • Infrastructure
    • Power & Cooling
    • Design
    • Innovations
    • Blog
Have an existing account? Sign In
Follow US
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
Data Center News > Blog > Global Market > How to log out of a Linux system from a script
Global Market

How to log out of a Linux system from a script

Last updated: July 30, 2024 2:08 am
Published July 30, 2024
Share
Night business woman with computer on glasses reflection for company innovation or eyes healthcare in digital, information technology career. Corporate manager reading, coding or software development
SHARE

Contents
Utilizing the supply builtinOne easy differentWrap-up

If you happen to run a script utilizing a command like exec myscript and the script features a logout command, the script will finish abruptly and so will the shell from wherein it was operating.

Utilizing the supply builtin

One other option to sign off of a system via a script is to make use of the supply builtin to run the script. Whenever you run a command corresponding to supply wait4three, the command will learn and execute all of the instructions included within the script simply as when you have been typing them. In different phrases, the constraints concerned in operating a script are eliminated.

One other advantage of utilizing the supply builtin is that you simply don’t want execute permission to run a script, simply learn entry.

One easy different

One quite simple different to logging out from inside a script is to run each the script and the logout command on one line – separated by a semicolon. This ensures that the logout command will run as soon as the script has completed.

$ wait4three; logout

The script proven earlier may then use exit as a substitute of logout.

#!/bin/bash

whereas true
do
  sleep 10
  depend=`who | wc -l`
  echo $depend
  if [ $count -ge 3 ]; then
    exit
  fi
performed

Wrap-up

Whereas logging out of a system from a script is never required, there could also be occasions when it is advisable to run a prolonged course of and wish to make sure that you’re logged out when it completes. Operating a script that features the logout command and operating with the exec or the supply builtin makes this doable.

See also  Nvidia: Latest news and insights

Source link

TAGGED: Linux, log, script, System
Share This Article
Twitter Email Copy Link Print
Previous Article ADT’s new smart security system is now available nationwide. ADT Plus features new ADT hardware and integrates with Google Nest cameras and video doorbells, and the Yale Assure Lock 2. ADT’s new smart security system launches
Next Article Amazon strives to outpace Nvidia with cheaper, faster AI chips Amazon strives to outpace Nvidia with cheaper, faster AI chips
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Trusted Source for Accurate and Timely Updates!

Our commitment to accuracy, impartiality, and delivering breaking news as it happens has earned us the trust of a vast audience. Stay ahead with real-time updates on the latest events, trends.
FacebookLike
TwitterFollow
InstagramFollow
YoutubeSubscribe
LinkedInFollow
MediumFollow
- Advertisement -
Ad image

Popular Posts

Former OpenAI executive Jade Leung named as PM’s AI adviser

Jade Leung, Chief Expertise Officer on the AI Safety Institute (AISI), has been named the…

August 18, 2025

Zenflow Raises $24M in Series C Financing

Zenflow, Inc., a South San Francisco, CA-based medical machine firm growing a minimally invasive therapy…

November 18, 2024

CommScope debuts RUCKUS Edge for cloud-managed services at the network edge

CommScope launched the RUCKUS Edge cloud-managed platform for service supply on the community edge. RUCKUS…

October 25, 2024

Quetta Data Centers pioneers sustainable edge expansion in Spain

Quetta Knowledge Facilities, launched by Azora in collaboration with Core Tech Capital, is making important…

December 11, 2025

Using laser beams to pioneer new quantum computing breakthrough

Optical computing makes use of mild’s velocity to carry out vector-matrix operations extra effectively. Harnessing…

December 3, 2024

You Might Also Like

System administrator typing supercomputer hub disaster recovery plan on laptop to provide fast restoration of service, limiting damage and minimizing interruptions to normal operations
Global Market

8 hot networking trends for 2026

By saad
Shutterstock Germany Only - News - Intel Factory Germany September 2024
Global Market

Intel sets sights on data center GPUs amid AI-driven infrastructure shifts

By saad
Side view of technician or engineer with headset and laptop standing in industrial factory.
Global Market

Is private 5G/6G important after all?

By saad
Levi’s Stadium hosts Super Bowl LX
Global Market

Super Bowl LX raises network expectations

By saad
Data Center News
Facebook Twitter Youtube Instagram Linkedin

About US

Data Center News: Stay informed on the pulse of data centers. Latest updates, tech trends, and industry insights—all in one place. Elevate your data infrastructure knowledge.

Top Categories
  • Global Market
  • Infrastructure
  • Innovations
  • Investments
Usefull Links
  • Home
  • Contact
  • Privacy Policy
  • Terms & Conditions

© 2024 – datacenternews.tech – All rights reserved

Welcome Back!

Sign in to your account

Lost your password?
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.
You can revoke your consent any time using the Revoke consent button.