LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-05-2023, 12:15 PM   #1
shirase
LQ Newbie
 
Registered: Nov 2023
Distribution: Linux for PlayStation 2
Posts: 8

Rep: Reputation: 0
Question Unsetting Variables & Terminator Placement


If I want to temporarily change the IFS like in the example here:
Code:
while IFS='' read -r var ; do cmd ; done ;
Then does it matter which of these are used?
Do they do anything different from each other?
Code:
env -u IFS ; cmd ;
env -u IFS cmd ;
IFS='' ; cmd ;
IFS= ; cmd ;
IFS='' cmd ;
IFS= cmd ;
OLDIFS=IFS ; unset IFS ; cmd ; set IFS=OLDIFS ; unset OLDIFS ;
OLDIFS=IFS ; unset IFS cmd ; set IFS=OLDIFS ; unset OLDIFS ;
 
Old 12-05-2023, 12:22 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,978

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
yes, they are not all the same, but some of them are identical.
You might want to set -xv before executing these commands to see the differences.
Also you can use different cmd -s to see how they react on those settings (like echo "'$IFS'")
 
1 members found this post helpful.
  


Reply

Tags
env, ifs, set, terminator



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Terminal on Linux Mint 17.1 version behaving like actual terminator animal in Terminator movie chanikya Linux - Newbie 1 03-16-2016 03:09 PM
[SOLVED] Unsetting environment variables. gharris Linux - General 1 04-12-2011 12:07 AM
fopen (stage.c:383) .failed .automatic unsetting Hawk124 Linux - General 0 12-25-2004 10:45 PM
unsetting a part of ENV variable praveenv Linux - Newbie 3 08-28-2004 09:36 AM
Gotta love those ٱٱٱٱٱٱٱ&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration