Detailed explanation of daily_routine example code in Linux

Detailed explanation of daily_routine example code in Linux

First look at the example code:

#/bin/bash


cal

date -u

echo "Hello, welcome ${LOGNAME}! A full day has begun!"


read -p "input your password!" pwd

if test $pwd == "123"
then
    echo "Your login sucessfully!"
    for file in /tmp/*
    do
        echo $file
    done
else
    echo "Deny logon"
fi

cal print calendar

date -u displays or sets the global time (Greenwich Mean Time)

${LOGNAME} Current logged in user

The above examples are very simple, you can try to test them. Thank you for your learning and support for 123WORDPRESS.COM.

<<:  MySQL 5.7.21 decompressed version of the tutorial to restore data through the historical data directory

>>:  Detailed explanation of using Docker to build externally accessible MySQL

Recommend

CSS achieves colorful and smart shadow effects

background Ever wondered how to create a shadow e...

How to build SFTP server and image server on Linux cloud server

First of all, you can understand the difference b...

Ubuntu 18.04 MySQL 8.0 installation and configuration method graphic tutorial

This article shares the installation and configur...

CSS animation combined with SVG to create energy flow effect

The final effect is as follows: The animation is ...

Vue implements the digital thousands separator format globally

This article example shares the specific code for...

Use Docker to build a Redis master-slave replication cluster

In a cluster with master-slave replication mode, ...

Get a list of your top 10 most frequently used terminal commands in Linux

I think the commands I use most often are: Choice...

Sample code for implementing history in vuex

I have recently been developing a visual operatio...

Solution to the docker command exception "permission denied"

In Linux system, newly install docker and enter t...

Detailed explanation of MySQL deadlock and database and table sharding issues

Record the problem points of MySQL production. Bu...

Detailed description of ffmpeg Chinese parameters

FFMPEG 3.4.1 version parameter details Usage: ffm...

Detailed explanation of memory management of MySQL InnoDB storage engine

Table of contents Storage Engine Memory Managemen...

Linux Domain Name Service DNS Configuration Method

What is DNS The full name of DNS is Domain Name S...

How to add abort function to promise in JS

Table of contents Overview Promise Race Method Re...