James G. Sack (jim) wrote:
Ralph Shumaker wrote:
James G. Sack (jim) wrote:
Ralph Shumaker wrote:
How can I get a script file to skip a large section?
Up to now, I've just been commenting out (as I go) the lines that have
already done what I need them to do and don't need them to do it
again. But every once in a while, I want *every* line to execute.
Is it something simple like:
if 1=0
.
.
.
fi
What you've done is actually a common practice during script development.
It might be easier to read if you put blocks of code into functions, and
then any one call can be disabled by a single comment-character.
I think I may have given mixed messages. I think that "if ... fi" is
part of certain programming languages, but I only used it as an example
of what I want to do. I'm working in a simple shell script
("#!/bin/bash").
Oh, you are looking for the syntax?
Have you tried man bash <wink> ;-)
if true
then
...
fi
if false
then
...
fi
function doit(){
...
}
doit
#doit
Do these give you some ideas?
Ask again, if/as required.
That's pretty much *exactly* the kind of thing I want. Thanks.
Now for a vim question. (I've gotten better with vim. I even
discovered (by accident) command history.)
In vim, how do you cut and paste? I like the function of "dd" to
vaporize a line and "9d" to vaporize 9 lines (and so on). But can I
delete one line (or more) and paste it somewhere else? How about copy
and paste? (This would make vim *far* more useful to me.)
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list