Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux command execution judge sentences -;, &&, ||     - JavaScript, some conclusions about the implicit conversion (Programming)

- Close and limit unused ports computer server security protection (Linux)

- Getting Started with Linux system to learn: how to install the kernel headers on Linux (Linux)

- How to configure Apache Solr on Ubuntu 14/15 (Server)

- Apache2.4.7 make an error [exports.lo] Error 1 Solution (Server)

- Use Visual Studio to compile and use WinGDB remote debugging embedded Linux programs (Programming)

- C language preprocessor command (Programming)

- Use ISO document production OpenStack used CoreOS mirror (Linux)

- About ORA-02391 solution (Database)

- Text analysis tools - awk (Linux)

- Linux performance optimization features Tuned and ktune (Linux)

- Oracle bug Ora-04043 (Database)

- Binding unofficial Google Drive and Ubuntu 14.04 LTS (Linux)

- Java in the final qualifier (Programming)

- Export error: ORA-04063: package body dmsys dbms dm model exp has error (Database)

- Android Service Lifecycle and usage (Programming)

- How to back up Debian system backupninja (Linux)

- Linux System Getting Started Learning: the curl set custom HTTP header (Linux)

- Java List add duplicate the same object (Programming)

- Performance Diagnosis of 60,000 milliseconds for Linux (Linux)

  Linux command execution judge sentences -;, &&, ||
  Add Date : 2018-11-21      
  Command execution judgment basis -;, &&, ||

In the Linux operation and maintenance during the ordinary course or Linux operating system will execute multiple commands at the same time, so we need multiple commands manner.


By using the ';' semicolon to execute multiple commands, such as for example:

#sync; sync; shutdown -h now


Run by the judge, && / || the implementation of such cases:

cmd1 && cmd2:

If cmd1 completed and executed correctly ($? = 0), then started cmd2

If cmd1 completed and incorrect execution ($?! = 0), then open cmd2 not executed

cmd1 || cmd2:

If after cmd1 completed execution ($? = 0) is correct, cmd2 not executed.

If completed after cmd1 error ($?! = 0), then started only cmd2

According to the above exercise to learn the contents of the following exercises:


Analyzing / home directory exists a file is created lshome

#ll / home && touch / home / lshome


Determine whether there is create a file / tmp / abc, if / tmp / abc does not exist, create

#ls -l / tmp / abc || mkdir / tmp / abc

3. Analyzing / home / Samlee directory exists, if there is displayed "exist", if there is no will display "not exist"

#ls -l / home / Samlee && echo "exist" || echo "not exist"
- MySQL partition table Comments (Database)
- Installation and Configuration Munin monitoring server on Linux (Server)
- ActionContext and ServletActionContext Summary (Programming)
- Linux for enterprises to build a firewall (Linux)
- iOS development -Launch Image and Launchscreen (Programming)
- Two alert log ORA Errors (Database)
- Linux can modify the maximum number of open files (Linux)
- To install Scribus 1.4.4 under ubuntu (Linux)
- Java threads in the life cycle (Programming)
- Linux CentOS configuration SVN + SVN hook (Server)
- PXE install CentOS 6.4 (Linux)
- Hardware Firewall Basics (Linux)
- How screenshots from the Linux command line (Linux)
- Notebook computer forget password solution (Linux)
- Linux file content inspection - cat, tac, no, more, less, head, tail, od (Linux)
- Oracle conditional select statements and looping statements (Database)
- Zabbix monitoring different versions of RAID installation and monitoring and MySQL master-slave monitor (Server)
- LMMS 1.03 install on Ubuntu 14.04 (Linux)
- Through eight skills to let you become a super Linux end-user (Linux)
- Docker installation under CentOS7 (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.