From d8fb645ac2f608e4939d260004694c5803c96f78 Mon Sep 17 00:00:00 2001 From: parthzz Date: Tue, 3 Oct 2023 09:03:11 +0530 Subject: [PATCH] ifs: add page (#10775) * ifs: add page --------- Co-authored-by: Jack Lin Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/common/ifs.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pages/common/ifs.md diff --git a/pages/common/ifs.md b/pages/common/ifs.md new file mode 100644 index 0000000000..0dc5020ca9 --- /dev/null +++ b/pages/common/ifs.md @@ -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: . + +- 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}}")`