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 اگر نادرست باشد.
|
|
|
|
> اطلاعات بیشتر: <https://www.gnu.org/software/bash/manual/bash.html#index-_005b_005b>.
|
|
|
|
|
|
|
|
- اینکه متغییری برابر/نابرابر با رشته ای معین است را بررسی میکند :
|
|
|
|
|
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}} {{==|=~}} {{pattern}} ]]`
|
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}} ]]`
|