LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   appending to file, or editing a file (https://www.linuxquestions.org/questions/linux-newbie-8/appending-to-file-or-editing-a-file-766155/)

ibabhelix 11-02-2009 02:36 AM

appending to file, or editing a file
 
i have a file

Code:

C4'  G A  1           
P    G A  2       
P    G A  2       
C4'  G A  1       
P    G A  2       
P    G A  2                                 
C4'  G A  1       
P    G A  2       
P    G A  2

at the end of each line i wanna add "......" that is the file must look like this :

Code:

P    G A  2....       
P    G A  2....       
C4'  G A  1....       
P    G A  2....       
P    G A  2....                                 
C4'  G A  1....       
P    G A  2....       
P    G A  2....

how do i do this ?
what command should i use ?
please help me

vijay_babu1981 11-02-2009 02:48 AM

This should work
sed 's/$/..../' INFILE > OUTFILE

ghostdog74 11-02-2009 03:27 AM

you have been exposed to shell scripting in your previous posts and its an easy task for this stated problem. Try to do it yourself and show your code next time.

pixellany 11-02-2009 06:57 AM

@ibabhelix;

What reference material are you using for learning shell scripting? Has anyone suggested http://tldp.org? If not, go there and get the Bash Guide for Beginners.

onebuck 11-02-2009 07:23 AM

Hi,

You might want to start with the 'Bash Beginners Guide'.

:hattip:

pixellany 11-02-2009 07:37 AM

Is there an echo in here?

ghostdog74 11-02-2009 07:54 AM

another Beginner guide

onebuck 11-02-2009 06:11 PM

Hi,

Quote:

Originally Posted by pixellany (Post 3741176)
Is there an echo in here?

Sorry,,,Sorry,,,Sorry! :)

I did not see your post. I copied the wrong link anyway, It should have been; Advanced Bash-Scripting Guide 6.1.

:hattip:


The above link and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!


All times are GMT -5. The time now is 06:26 PM.