Re: Remove the first 3 characters after reading each line
- From: "Fred Kleinschmidt" <fred.l.kleinmschmidt@xxxxxxxxxx>
- Date: Thu, 28 Sep 2006 17:24:06 GMT
<nicetom786@xxxxxxxxx> wrote in message
news:1159461178.490764.15280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi ,
I am new to unix .
I have a file to read and after reading each line I want to strip off
the first 3 characters and store in another variable.
Cut command cuts the first 3 characters but I do not how to get the
rest of letters.
For ex:
I have a line XXX_JOBNAME
Here is the code
cat jobs.txt |cut -c1-4
This prints XXXX_.
I want JOBNAME to be printed .But length of JOBNAME differs in each
line.
cat jobs.txt | cut -c5-
--
#Logic
ext=".ksh"
for line in `cat ~/jobs.txt`
do
echo $line
#remove the XXX_
#put the cut logic here after ripping of 3
characters and strore in another variale "job"
#concanat .ksh to each job = $job
job="$line$ext"
echo $job
#copy from SRC to taget
#cp ~/src/job.ksh ~/target
done
pls guide.
Thanks
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
.
- References:
- Remove the first 3 characters after reading each line
- From: nicetom786
- Remove the first 3 characters after reading each line
- Prev by Date: Re: how to solve the philosopher problem .and what's wrong with my codes.
- Next by Date: Re: how to solve the philosopher problem .and what's wrong with my codes.
- Previous by thread: Re: Remove the first 3 characters after reading each line
- Next by thread: Re: Remove the first 3 characters after reading each line
- Index(es):
Relevant Pages
|