2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
# [
|
|
|
|
|
|
|
|
|
|
> بررسی نوع فایل و مقایسه مقدار ها
|
|
|
|
|
> عدد 0 برمیگرداند اگر شرط درست باشد و 1 اگر شرط نادرست باشد
|
2024-09-10 21:52:30 +01:00
|
|
|
|
> اطلاعات بیشتر: <https://gnu.org/software/bash/manual/bash.html#index-test>.
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- بررسی میکند که آیا یک متغییر با رشته معین برابر است یا نابرابر :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ "${{variable}}" {{=|!=}} "{{string}}" ]`
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- اینکه متغییری برابر/ نابرابر/ بزرگتر از/ کوچکتر از/ برابر یا بزرگتر/ کوچکتر یا برابر با عددی است را بررسی میکند :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ "${{variable}}" -{{eq|ne|gt|lt|ge|le}} {{integer}} ]`
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- اینکه متغییر با مقدار معین دارد یا مقدار نا معین دارد را بررسی میکند :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ -n "${{variable}}" ]`
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- اینکه متغییری مقدار تهی دارد را بررسی میکند :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ -z "${{variable}}" ]`
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- اینکه فایل معینی وجود دارد یا خیر را بررسی میکند :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ -f {{path/to/file}} ]`
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- اینکه دایرکتوری معینی وجود دارد یا خیر را بررسی میکند :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ -d {{path/to/directory}} ]`
|
2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation (#10603)
* 2to3, 7za, 7zr, [, [[, android/*: add Farsi Translation; 7z: update Farsi Translation
---------
Co-authored-by: mortalpuppet <misagh.sj@mgail.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-09-14 16:31:28 +01:00
|
|
|
|
|
|
|
|
|
- اینکه فایل یا دایرکتوری معینی وجود دارد یا خیر را بررسی میکند :
|
|
|
|
|
|
2024-01-05 10:18:59 +00:00
|
|
|
|
`[ -e {{path/to/file_or_directory}} ]`
|