a simple question please
i have this code, and it add the word echo for all lines, but i want exclusively to odd lines
i kwow that this code sed -n 1~2p’ show me all odd lines, but i can’t doing the same in script above
sed 's/.*/echo &/' $startdirectory
thanks
For a literal answer to what you’re asking (apply an ‘s’ action to every other line), you want
This is marginally better than the
Nway of doing things in that it doesn’t interfere with other things you might want to do to other lines in the file.