Re: [opensuse] bash - why doesn't the tldp bash beginners guide for loop example work?



David Bolt wrote:
On Fri, 15 Feb 2008, Randall R Schulz wrote:-

On Thursday 14 February 2008 23:13, David C. Rankin wrote:
...

Stumbling around, it seems if you include AFS='\n' it will keep the
loop from breaking on spaces by specifying that it only break on
newlines and not spaces. So filenames with spaces (all my wife's
digital pictures are) this is the only thing I have found to work
without extensive character and replacing spaces with '_':
It's "IFS" not "AFS" and you need the "in" keyword as David Bolt
mentioned:

And if the script is more than just a quick one-liner, you should really
be saving and restoring the old IFS, or you can end up with some rather
difficult to diagnose failures. You can find an example of this is in
/etc/init.d/alsasound


IFS is what I used, don't know how AFS got in there.

Yes, it was kind of comical when after running the script I had managed to loose the "ls" command. I'm not entirely sure it was the IFS, but I just logged out and logged back on and all was well.

--
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Debug.exe for win32
    ... Format is: n) e address t=n ... Display the debug registers. ... R DRx command. ... The help output can be limited by specifying the first letterof the ...
    (alt.lang.asm)
  • Re: Startup.cmd
    ... I can't recall ever having tested this in an OS/2 session with earlier versions of OS/2, but both eCS1.2 and MCP1 refuse to execute a hidden cmd or exe file. ... If it works in a DOS session, ... You can either set these options at the dir command or by ... However if a bat or exe file is hidden it can still be executed in the usual way by specifying its name on the command line. ...
    (comp.os.os2.bugs)
  • Re: Simple questions about building C program
    ... Library/Object system, and not the unix-y IFS, where my files are. ... end, have my CRTSVRPGM command, and say to the AS/400 "call these ... There may be a simple way to run a CL script directly from a stream file ... FTP supports storing into database files (in QSYS.LIB file system), ...
    (comp.sys.ibm.as400.misc)
  • Re: How to get the application path
    ... I guess in the cases I use it, I always launch a program by specifying ... That is typically the case for launching from an icon, ... I'm enougb of a dinosaur that I still use command lines for ... the string refers to. ...
    (comp.lang.ada)
  • Re: Simple questions about building C program
    ... Library/Object system, and not the unix-y IFS, where my files are. ... file system as well as others such as "root" and QOpenSys that behave more like a Unix file system. ... The CRTCMOD command allows LIB/FILE/MEMBER source input file SRCFILE and SRCMBR parameters. ... So one option might be to FTP your script into a database file/member, to enable direct input to a command such as SBMDBJOB or CRTCLPGM. ...
    (comp.sys.ibm.as400.misc)