LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-25-2006, 05:24 PM   #16
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235

example in a text like 'a ab abc abcd', the cmd's for loop can do selecting a, or just ab abc, or all but not a. and many other things without using a program like cut.

it can also skip lines, have custom delimeters and eol, do some variable expansion like remove quotes, show pathname only, show filename only, drive letter only... many others more.

like bash for's (( ; ; )), the cmd's for also have for /l

i guess it's something like we can call.. a merged tool of bash's for and cut with some more parsing.
 
Old 07-25-2006, 05:31 PM   #17
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Interesting. Though, as I remember, power tools are behind syntax forest. Maybe it's an idea to have a more powerful builtin. (Too bad it can't be just shell function)
 
Old 07-26-2006, 12:56 PM   #18
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
In addition to what konsolebox said about splitting the text, this can also be applied to files with /F, which allows you to do some reasonably complicated processing. For example, you can use REG to dump registry keys to a file and then process them one by one. Delayed expansion is another feature that is very useful but usually overlooked. For the best details on what CMD can do, check FOR /?, SET /?, CMD /?, and SETLOCAL /?. A shame there is no simple 'man cmd'
 
Old 07-26-2006, 02:57 PM   #19
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
In W2k there was a fairly comprehensive master help topic (F1).

It had links to the sections for each of the cmd-line commands.

Especially useful was the "batch" section & the "for" section it referenced.

My memory (Win free since mid-May 2005) is that it is very hard to find; & once you do, bookmark it.
 
Old 07-26-2006, 05:20 PM   #20
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by raskin
Interesting. Though, as I remember, power tools are behind syntax forest. Maybe it's an idea to have a more powerful builtin. (Too bad it can't be just shell function)
nah i don't want a heavy function included in the bash shell. that will just make things slower.
 
Old 07-27-2006, 03:59 AM   #21
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, if you don't use it, it just increases executable size. Not that it will have a great impact (600K already). If you use it, it replaces writing logic in bash - and gives speed.
 
Old 07-27-2006, 04:14 AM   #22
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
i don't know. bash strictly follows the posix's specifications so that's still impossible to happen. especially if the code came from WXs.
 
Old 07-27-2006, 08:33 AM   #23
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Ha. Very funny. No extensions. Not one. 'caller' builtin was in POSIX forever. And surely no omissions.

OK, I don't ask in bash, only in Zsh.

Seriously, bash has extensions. I don't think the mentioned builtin should mimic windows shell behavior (which is not suitable for complex commands), but it could be comparable in power.

But as I'm too lazy to write such a builtin for zsh, it's only theory.
 
  


Reply



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
"clear" and "reset" bash commands broken AviJacobson Linux - General 6 07-03-2006 06:28 AM
"clear" and "reset" bash commands broken AviJacobson Linux - Software 1 06-29-2006 02:31 PM
.kde/Autostart bash scripts "file not found" Nice-n-Slow Linux - Software 1 07-02-2004 05:25 PM

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

All times are GMT -5. The time now is 07:08 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