Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Bash variable expansion modifier     - Improve the efficiency of Linux development tools 5 (Linux)

- Upload the project to GitHub, synchronous remote repository Github (Linux)

- Python format string (Programming)

- MacBook Air install Ubuntu dual system (Linux)

- Python is not C (Programming)

- Five Linux user space debugging tool (Linux)

- Empty password Linux operating system (Linux)

- Ubuntu ADSL dial-up Internet access (Linux)

- To resolve Ubuntu 14.04 Unity Desktop Environment Login freeze problem (Linux)

- C # assembly calls across constants, variables and functions (Programming)

- Linux / BSD firewall M0n0wall Profile (Linux)

- Ubuntu 14.04 virtual machine switching desktop environments (Linux)

- How to install and configure in Ubuntu 14.10 'Weather Information Indicator' (Linux)

- JavaScript is implemented without new keywords constructor (Programming)

- An Analysis of the C Algorithm for Calculating the Number of Days Between Date (Programming)

- Java interface and inheritance (Programming)

- Generated characters using Java Videos (Programming)

- Linux host dual LAN transceiver package ARP problem (Linux)

- Android using SVG vector graphics to create cool animation effects (Programming)

- Du and df show disk space usage inconsistent Causes and Treatment (Linux)

 
         
  Bash variable expansion modifier
     
  Add Date : 2018-11-21      
         
         
         
  Bash variable expansion modifier

1, is not provided on a temporary replacement (:-)

Colon: used to test whether a variable is set before, if there is no colon, then that is set before, do not replace
$ Fruit = peach
$ Echo $ {fruit: -plum}
peach

$ Fruit =
$ Echo $ {fruit: -plum}
plum

$ Echo $ fruit
$

2, is not set on the permanent replacement (: =)

$ Name =
$ Echo $ {name: = Peter}
Peter

$ Echo $ name
Peter

3, set up on a temporary replacement (: +)

$ Foo = grapes
$ Echo $ {foo: + pears}
pears
$ Echo $ foo
grapes

4, is not set to print messages (:?)

$ Echo $ {namex:? "Namex is undefined"}
namex: namex is undefined

$ Echo name = $ {1:? "Requires an argument"} // apply the script parameter detection position
1: requires an argument

echo $ {y?}
y: parameter null or not set // print a default message

5, substring (: m: n)

$ Var = notebook

$ Echo $ {var: 0}
notebook

$ Echo $ {var: 0: 4}
note

$ Echo $ {var: 4: 4}
book
     
         
         
         
  More:      
 
- MySQL query plan key_len know all (Database)
- Linux remote connectivity tools -OpenSSH (Linux)
- Summary Linux bond of multi-interface load balancing (Linux)
- How to handle special characters in JSON (Programming)
- Windows7 system using Vagrant to build Linux virtualized development environment (Linux)
- TOAST function in PostgreSQL (Database)
- Ubuntu GCC, G ++ and fortran Version Switch (Linux)
- Safety testing Unix and Linux server entry succinctly (Linux)
- Let the router be your security barrier against external attack (Linux)
- Timeout control related to Python threads and a simple application (Programming)
- ethtool implementation framework and application in Linux (Linux)
- Linux System Getting Started Tutorial: Installing Brother printer in Linux (Linux)
- Forbid screen change the window size when creating a new window under CentOS (Linux)
- Linux, security encryption to transfer files between machines (Linux)
- Linux start the process (Linux)
- Upgrading to MySQL 5.7.9 MySQL 5.6.23 (Database)
- Can not empty the Recycle Bin to repair problems in Ubuntu 14.04 (Linux)
- How to install new fonts on Ubuntu 14.04 and 14.10 (Linux)
- Linux, Oracle listen address modification (Database)
- Linux configuration startup mount: fstab file (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.