mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
ifs: add page (#10775)
* ifs: add page --------- Co-authored-by: Jack Lin <blueskyson1401@gmail.com> Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
This commit is contained in:
parent
6538886138
commit
d8fb645ac2
1 changed files with 21 additions and 0 deletions
21
pages/common/ifs.md
Normal file
21
pages/common/ifs.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# IFS
|
||||
|
||||
> IFS (Internal Field Separator) is a special environment variable that defines the delimiter used for word splitting in Unix shells.
|
||||
> The default value of IFS is a space, tab, and newline. The three characters serve as delimiters.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html>.
|
||||
|
||||
- View the current IFS value:
|
||||
|
||||
`echo "$IFS"`
|
||||
|
||||
- Change the IFS value:
|
||||
|
||||
`IFS="{{:}}"`
|
||||
|
||||
- Reset IFS to default:
|
||||
|
||||
`IFS=$' \t\n'`
|
||||
|
||||
- Temporarily change the IFS value in a subshell:
|
||||
|
||||
`(IFS="{{:}}"; echo "{{one:two:three}}")`
|
Loading…
Add table
Reference in a new issue