Redirect I/O to same file without temp file [SOLVED]

Is there a simple way to do the following?
command < file > file.tmp; mv file.tmp file
Basically, I'm looking for a command-agnostic "< file > file" that doesn't just truncate file.
I'm using zsh, if that matters.
Last edited by muflax (2009-03-10 01:36:24)

Hi, i just uploaded a PKGBUILD[#1] for "rewrite" tool.
Usage: rewrite [-v] [-r "s/old/new/"] files.. "cat|cat"
-v verbose output (show compression ratios)
s/old/new/ sed expression for renaming files
files.. input file names to rewrite through pipeline
"cat|cat" pipeline expression to rewrite file through
This is a simple command for this purpose For example:
For example:
$ rewrite README "grep -v the"
[#1] http://aur.archlinux.org/packages.php?ID=24530
Last edited by djgera (2009-03-09 22:30:53)

Similar Messages

  • How to read the data file and write into the same file without a temp table

    Hi,
    I have a requirement as below:
    We are running lockbox process for several business, but for a few businesses we have requirement where in we receive a flat file in different format other than how the transmission format is defined.
    This is a 10.7 to 11.10 migration. In 10.7 the users are using a custom table into which they are first loading the raw data and writing a pl/sql validation on that and loading it into a new flat file and then running the lockbox process.
    But in 11.10 we want to restrict using temp table how can we achieve this.
    Can we read the file first and then do validations accordingly and then write to the same file and process the lockbox.
    Any inputs are highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hello Gurus,
    Let me tell you about my requirement clearly with an example.
    Problem:
    i am receiving a dat file from bank in below format
    105A371273020563007 07030415509174REF3178503 001367423860020015E129045
    in this detail 1 record starting from 38th character to next 15 characters is merchant reference number
    REF3178503 --- REF denotes it as Sales Order
    ACC denotes it as Customer No
    INV denotes it as Transaction Number
    based on this 15 characters......my validation comes.
    If i see REF i need to pick that complete record and then fill that record with the SO details as per my system and then submit the file for lockbox processing.
    In 10.7 they created a temporary table into which they are loading the data using a control file....once the data is loaded into the temporary table then they are doing a validation and updating the record exactly as required and then creating one another file and then submitting the file for lockbox processing.
    Where as in 11.10 they want to bypass these temporary tables and writing it into a different file.
    Can this be handled by writing a pl/sql procedure ??
    My findings:
    May be i am wrong.......but i think .......if we first get the data into ar_payments_interface_all table and then do the validations and then complete the lockbox process may help.
    Any suggestions from Oracle GURUS is highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

  • Can I create multiple links to the same file without duplicating file?

    does anyone know if it is possible to create multiple links to the same file using iWeb without the program automatically making multiple copies of that file in the published output? It seems that one file is created for each link.
    Thanks!

    Hi Franz,
    have a look at the second method on this page
    http://alyeska.altervista.org/en/iWeb_Downloads.html
    see if you understand how it works (if you don't, please ask me)
    Regards,
    Cédric

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • The photo print quality from my Mac to my Epson Artisan 810 is poor.  When I take the same photo files (JPEGs) to my PC to print to the same printer without even uploading them to the PC, they print brighter and crisper from my PC.

    The photo print quality from my Mac to my Epson Artisan 810 is poor.  I just purchased my iMac for my photography business in Jan. (this is my first Mac).  When I first tried printing, I noticed the quality wasn't as good as I expected it to be.  Then, I had to print 4-3.5x5s on a sheet, so I e-mailed the image to myself and opened it on my PC to print it (much easier to print that way on PC in Windows Photo Gallery - I think it's impossible to print that way in iPhoto).  That's when I first noticed that when I take the same photo files (JPEGs) to my PC to print to the same printer without even uploading them to the PC, they print brighter and crisper from my PC.
    I've already been on the phone and e-mail w/Applecare many times over this issue. We've tried creating a test user and printing from there, and we've tried reinstalling the OS.  I've tried printing from iPhoto, ImageCapture, and Preview apps/utilities, all w/the same result - no comparison to the PC-printed versions (no enhancements have been performed on the PC).
    I'm out of ideas, and so is Applecare.  They say it's most likely a driver issue b/c the printer is outdated, and that the only solution is to buy a new printer.  BUT it is a pain for me to purchase a new printer - it takes days of research due to the nature of my business and the fact that I need a printer that can print directly onto a disc.  I love this printer and don't want to have to buy a new one if I don't have to.

    englishfreak2004 wrote:
    Yes.  I've checked for updates, and the driver I installed is the same as the one on Epson's website.  I also spoke with Epson Customer Service, which was a dead end.  Apple says the problem is due to an Epson driver issue (blaming Epson), but Epson says that with the older printers, it's actually Apple who creates the driver, so the problem is actually with Apple.  Typical he-said, she-said...
    Maybe not. Probably worth checking here:
    Epson drivers for Mavericks:
    http://www.epson.com/cgi-bin/Store/support/SupportMavericks.jsp

  • PROBLE WHILE RENDERING IN CC While as In CS renders without any issue the same file from same location but tried 3 CC ,machine and have the same issue.

    Please i need an Urgent Help
    I just installed for my users 5 Machines with Adobe CC and they are all crashing while rendering to QT H264.
    while in cs6 it renders the same file in the same location without any issue.
    Please help it is urgent.
    Regards

    Hi,
    I can't really read the error appearing in the screenshot you shared.  Is the application fully up to date?
    Have you read: After Effects CC 2014 - removal of H.264, MPEG-2, WMV, FLV, F4V, and SWF exporters - WHY !?
    This might also be an explanation, as i believe you are trying to use h.264 right?
    Kind Regards,
    Harrie

  • When I try to open a pages document on my mac book pro it says "The file 'thesis.pages' couldn't be opened." But i can open the same file on my iPad and iPhone without a problem.

    When I try to open a pages document on my mac book pro it says "The file 'thesis.pages' couldn't be opened." But i can open the same file on my iPad and iPhone without a problem.

    Thanks very much for the instructions.  I encountered this problem this morning myself and the recommendation fixed the problem immediately.  When things like this happen with iCloud and Pages it makes me wonder if I might be better off using something else, having just recently had to fix the problem that the current Pages can't read documents I created with a much earlier version until they were "upgraded" by an interim version.

  • Is there any way for additions made by one user of a shared library to be visible to the other user of the same library, without having to always "add file to library"?  This was the whole reason we consolidated the library into a public folder

    My wife and I share a computer but have separate Windows ID's.  We also each have an iTunes account, using two separate Apple ID's.  We have always struggled with the headache of getting music that one of us added (via purchase, downloading CD, etc.) to the other person's music library.  A friend suggested we consolidate and share the same library.  Sounded like a good idea so we moved the libraries to a public folder, consolidated them, etc.  But now when one of us adds music to the library, the other person still has to do an "add file/folder to library" in order for them to be able to see it.  This is exactly the step we were hoping to eliminate by this consolidation.  Does anyone know if there is a way to make this happen automatically, or will we have to continue to do this every time?
    Also, ended up with a lot of duplicates in the process of consolidating.  Is there any way to identify and "mass delete" these?  It will take a while to go through them all individually as the library is somewhat substantial (approx. 16k songs)
    Hardware is Windows 8, one iPod classic, one iPod Nano (obviously only selected playlists on this one).  All hardware and iTunes running latest software.
    Any information would be appreciated!

    It sounds like you are using two independent libraries with a common media folder, whereas the plan would have been to ensure that both profiles were using the same library library database. Although you can place this within the Public folder I would normally create a shared library at the root of a drive, e.g. at X:\iTunes where X: is the drive that you want to use. See Make a split library portable for information on moving the library around back into a standard shape.
    As for duplicates, Apple's official advice on duplicates is here... HT2905: How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls such as lost ratings and playlist membership.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See thisthread for background, this post for detailed instructions, and please take note of the warning
    to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed.)
    The most recent version of the script can tidy dead links as long as there is at least one live duplicate to merge stats and playlist membership to and should cope sensibly when the same file has been added via multiple paths.
    tt2

  • How to keep same file name in File to Mail-Without Ripository Object??

    Hello Experts,
    I have a requirement where I need to pick a file and need to send that as an attachment by mail adapter through PI.
    I can send the file as attachment but the file name is being changed.
    For example,the source file with name "Vendor_2011_11_06" is being transfered but when I am checking the mail box,the file is coming as attachment but the name has been changed to "Untitled.bin".I want the same file name as it was in source SFTP server.
    Do any one have any idea that how can we set the file name at receiver mail adapter?
    **Note:I have not created any repository objects,simply configured the ID object with dummy Service Interface name.So no mapping exist.

    Hi,
      For example,the source file with name "Vendor_2011_11_06" is being transfered but when I am checking the mail box,the file is coming as attachment but the name has been changed to "Untitled.bin".I want the same file name as it was in source SFTP server.
        by using MessageTransformBean you can acheive this.
    Transform.ContentDisposition------  attachment or inline  For example, attachment;filename=u201Dabc.txtu201D
    Transform.ContentDescription------- Description
    Transform.ContentType------Specifies the payload type, for example, text/plain
    refer this blog
    http://wiki.sdn.sap.com/wiki/display/XI/DynamicEmailAttachmentnameforReceivedMails  
    i hope this will help you.
    regards,
    ganesh.

  • I want to open a folder in a separate window by clicking on it.  For some reason when I click on a folder it just replaces the one I was just in.  I want them both to be open at the same time without having to go through several steps.

    I want to open a folder in a separate window by clicking on it.  For some reason when I click on a folder it just replaces the one I was just in.  I want them both to be open at the same time without having to go through several steps. Old apple operating systems made it easy to have several folders open at one time. 

    Eric, thanks that works but seems like an extra added step also to do it that way.  I've got to move and organize a ton of files and I'm looking for a easy way to get this done.  I could also open the folder into a separate tab and then drag the tab out so it becomes an open window but thats a lot of fussing around also with extra steps.  Not sure why these newer operating system seems more confusing and less user friendly than what they used to.  In the past I could just click on any folder and it would open in a separate window making it really easy to copy or move files from one place to the other just by simply dragging them from one window to the other.  Seems like I'm going through several extra steps now to do a simple task. 

  • How can i run 2 i tunes accounts on the same computer without songs duplicating?

    my wife and I both have ipods, how do you run an account each on the same computer without files syncing on both ipods/ libraries?

    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers4. I
    have made substantial changes to improve readability and syntax.

  • How can I save images and text data to the same file?

    I have been looking at ways to do this for a while. My main VI saves the raw data to a text file which the users then import to Excel and plot. I am trying to simplify this process and have been looking at ways to accomplish this task. I want to be able to save the raw data to a file and then save the Labview graph as well. This will eliminate the tedious task of importing the raw data into Excel and plotting it. I can save the raw data to its own file and I can use the Get Image method for the graph and save it to its own file. I am currently using the .png format. Is there a way of saving both to the same file ie, importing the image into Excel or Word etc. Before I go off doing a science project I wanted to see if anyone else had experience completing this task and had any recommendations. Thanks in advance for any help.

    well ther are a couple of ways. You could use the standard report generation VI's and make a complete report with the image of the graph embedded into the report with the raw data or you could use activeX and control excel thru LV and put the raw data into excel directly and have excel graph the data without any user interaction. I have posted a slew of VI's on the excel board if you do not have the report generation toolkit. If you could tell me which way you want to go I could possibly send you an example.
    For more information and some sample VI's and tool kits, you can go to the excel board
    Joe.
    "NOTHING IS EVER EASY"

  • When saving a File OS Is Creating Multiple Folders With The Same File Name

    Not sure what I changed but, now when I save a any file (ppt. word, Keynote,Pages e.g.,) to the desktop or any other location the OS will also create multiple file folders with the same file name as the file I'm saving. Inside the folders are what appears to be files locating the saved files. What can I do to fix this problem?
    I'm using the 10.7.2 version
    MacBook Pro

    Misio wrote:
    It looks like a finder bug. To replicate, I surf to any website, I right-click on a jpg image, select "Save Image As" and in the window that pops up I type in the filename "000.jpg", I select the folder Pictures, and click on Save.
    BTW, I don't know why, but the file was saved only as "000" without the file extension ".jpg". Does anybody know why?
    the extension is simply hidden. go to the get info panel for the file and uncheck the option to hide the extension.
    Then I surf to another image, and again I save it as "000.jpg" and now it asks me if I want to replace the existing filename, although the existing one is "000" and I try to save as "000.jpg", so I say yes, and then magically the file is saved with the full filename including the extension "000.jpg"
    When I did it a couple of times, always saving image as "000.jpg" from various sources, I ended up with two distinct files named "000" and both in the same folder Pictures.
    Please advise.
    it sounds to me like you saved one file as 000.jpg and the other and 000.jpg.jpg.
    check the info panels for the files for full names to verify if this is the case.

  • Mac on Windows SMB Share- IDLK files disappearing allowing several users to access the same file

    Hi,
    We have a volume licensing agreement with Adobe and have around 16 Adobe CS6 licenses all used on Macs. The network is based around Windows servers and shares which the Macs connect to via an SMB connection to the server. The issue we're having is that when an InDesign file is opened, sometimes it will not create an IDLK file (or sometimes it will create one but it will disappear seconds later) and it allows several people to view the same file at the same time. Obviously two or more people working on the same file can, will and has caused issues with overwriting documents without knowledge of doing so.
    Has anyone else encountered this or have any ideas as to what might help us resolve this issue?
    Thanks

    When you open a file from a previous version (you'll see converted in
    the file name) there is no CS6 file in existence, yet. Once the file is
    saved as a CS6 file, the lock file is created. The whole procedure is
    designed so that you must make a fully conscious decision to overwrite
    the old version file with a new one.
    This is no different than creating a new document that hasn't been saved
    yet.

  • How can i save differnts data in the same file?

        Hi all,
    i need some help.  I'm working  on a project  for students an th university. We have to devellop  a programm for LEDs measurement so that all the measure data must be save in de same file.  We have develloped the programm, but we have  a big problem to save the measure in the same File.
    When we do the first  measure , the file must be created and the fisrt data gonna be save in this file that is correct
    When wie do the second measure, the third  ....  measure, the programm ask us to comfirm the file or where we want save our data
    We need some help, to know how we can change  or devellop this programm so that, for the first measure , the file must be created and the fisrt data gonna be save in this file,  the second measure the same file must be chose and from the third and more the measure data must be automatically save in this file without the programm ask to chose or to confirme a file? 
    I attach a part off this programmm
    Thanks
    Attachments:
    SR830DSP19.vi ‏212 KB

    Move the "File Dialog" where you open your new file out of the while loop. Only pass the refnum inside the loop.

Maybe you are looking for