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

Detailed explanation of MySQL alter ignore syntax

When I was at work today, the business side asked...

Docker container operation instructions summary and detailed explanation

1. Create and run a container docker run -it --rm...

Basic usage and examples of yum (recommended)

yum command Yum (full name Yellow dog Updater, Mo...

Detailed explanation of docker entrypoint file

When writing a Dockerfile, include an entrypoint ...

Vendor Prefix: Why do we need a browser engine prefix?

What is the Vendor Prefix? Vendor prefix—Browser ...

How to deploy nginx with Docker and modify the configuration file

Deploy nginx with docker, it's so simple Just...

About if contains comma expression in JavaScript

Sometimes you will see English commas ",&quo...

Web page custom selection box Select

Everyone may be familiar with the select drop-dow...

How to filter out duplicate data when inserting large amounts of data into MySQL

Table of contents 1. Discover the problem 2. Dele...

Example code for drawing double arrows in CSS common styles

1. Multiple calls to single arrow Once a single a...

Win10 installation Linux system tutorial diagram

To install a virtual machine on a Windows system,...

Docker connects to a container through a port

Docker container connection 1. Network port mappi...