1. Get the real path of the current script: #!/bin/bash if [[ $0 =~ ^\/.* ]] #Judge whether the current script is an absolute path, matching all thens starting with / script=$0 else script=$(pwd)/$0 fi script=`readlink -f $script` #Get the real path of the file script_path=${script%/*} #Get the directory where the file is located realpath=$(readlink -f $script_path) #Get the real path of the directory where the file is located echo $script echo $script_path echo $realpath 2.readlink -f: Get the real file location of the symbolic link, and finally get the real file location of the symbolic link 3.basename: Get the file name of the file 4.dirname: Get the directory name of the file Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: React example showing file upload progress
>>: Mysql delete duplicate data to keep the smallest id solution
MySQL sets up independent writing separation. If ...
The first method: Use Junge's one-click scrip...
MySQL binary installation method Download mysql h...
All prerequisites require root permissions 1. End...
Table of contents 1. Rename table method 2. Notes...
Docker has been very popular in the past two year...
Preface: The storage engine is the core of the da...
Table of contents MySql8.0 View transaction isola...
Table of contents Preface 1. What variables are p...
Skip the Docker installation steps 1. Pull the po...
The data type of MySQL is datetime. The data stor...
1. overflow:hidden overflow hidden If overflow:hi...
1. List The list ul container is loaded with a fo...
1. Native network request 1. XMLHttpRequest (w3c ...
Table of contents Preface: Specific operations St...