User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,428 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,575 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1305 | Replies: 1
Reply
Join Date: Apr 2007
Posts: 1
Reputation: dianabippu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dianabippu dianabippu is offline Offline
Newbie Poster

Help How to insert new argument into the middle of a file

  #1  
Apr 12th, 2007
I wrote a script as below

#!/bin/bash
echo $1 > temp
cat $2 >> temp
mv temp $2 # this command helps us to retain the original name of the file #

now how to append the script so tht it now inserts the first argument into the middle of the file and also the original file must retain its original name. http://www.unix.com/images/buttons/edit.gif
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore, India
Posts: 535
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Rep Power: 4
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: How to insert new argument into the middle of a file

  #2  
Apr 16th, 2007
>> now how to append the script so tht it now inserts the first argument into the middle of the file and also the original file must retain its original name.
Not clear what you wanna do??
append the script => append which script? append TO what?
middle of the file => Which file?
original file => Which is the original file?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 1:14 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC