logo       

Simple Conditional execution in a script: msg#00015

editors.sed.user

Subject: Simple Conditional execution in a script

Friends,

We are trying to accomplish a simple conditional exeuction of a
statement using sed or perl script,

We are trying to read a line from a file and generate a separate set
of files based on the lines from that file,

In most cases our source file has a number which tells us how many
files to create, so we have to read from a file called 07122005.bak,
which has just a number '25', we need to generate
07122005_1.bak ..07122005_25.bak

We have tried commands like more, head and cat to read the line into
a variable so that we could loop that many times, but when we use
those commands it is inserting a EOF into the variable value which
negates our downstream use of the variable

our script looks like
cat 07122005.bat > $u
echo $u

This returns
25
EOF

Any suggestions?

BTW, we are on a sun box(solaris)





------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/dkFolB/TM
--------------------------------------------------------------------~->

--

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/sed-users/

<*> To unsubscribe from this group, send an email to:
sed-users-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise