Ubuntu :: Saving Output In File

Feb 16, 2010

I am using system() command to save command output in txt file and i am storing in one character variable.

For example Code: system("ls>output.txt"); but what should i do when i have to save another one command output in the same txt file continuously, for example

Code:

The output of these 2 commands should come in one txt file continously it should get over write.

View 1 Replies


ADVERTISEMENT

General :: Saving Awk Output To File?

Feb 2, 2010

I have a problem with saving output from awk to a file. The commands I tried:

Code:

$ top | awk '/Cpu|Mem/ {if ($1 ~ /Cpu/) {printf strftime("%H:%M:%S")" "; printf strtonum($3)" ";} if ($1 ~ /Mem/) {printf ($5/$3)*100; printf "
";}}' > file.out

and

Code:

$ top | awk '/Cpu|Mem/ {if ($1 ~ /Cpu/) {printf strftime("%H:%M:%S")" "; printf strtonum($3)" ";} if ($1 ~ /Mem/) {printf ($5/$3)*100; printf "
";}}' &> file.out

In both cases file.out is empty. What am I doing wrong?

View 2 Replies View Related

Software :: Saving Output In One File?

Feb 16, 2010

I am using system() command to save command output in txt file and i am storing in one character variable. for example

Code:
system("ls>output.txt");
but what should i do when i have to save another one command output in the same txt file

[code]...

View 1 Replies View Related

Applications :: Saving Postscript Output - How To "print To File"

Mar 21, 2010

Been using gv and vi to build a postscript file. Now I would like to save the output of the program to a disk file. My problem is I can't figure out how to "print to a file".

View 2 Replies View Related

General :: Saving The Output Of "ls" Command In Color?

Nov 25, 2010

When I save the output of "ls" command to a "txt" or "rtf" file, the color information is lost. Is there any way to retain the color code of different files/directories obtained by the command "ls --color" while saving?

View 14 Replies View Related

General :: Vim: Jumping From File C1 To File C2 Without Saving C1 First

Jul 31, 2011

Kernel 2.6.21.5, slackware 12.0
Vim 7.1

I do 'vim c1 c2' and I begin copying parts of c2 to c1 (yank, put). Now, each time I go back to c2, I must save c1 first. But it happens that I'm not sure I want to save it. Is there a way to go back and forth between c1 and c2, making changes to one of them, without having to write to disk before switching? Notice the changes must be kept.

View 9 Replies View Related

Ubuntu Servers :: Gedit / Nautilus And SSH File Saving?

Jul 13, 2010

I connect with ssh to an Ubuntu server to edit some files in /var/www witch I have set the setgid bit:

# sudo chgrp -R www-data /var/www
# sudo chmod -R 770 /var/www
# sudo chmod -R g+s /var/www

I have added the user "user" to www-data group. Now I connect using ssh as user "user" to my server with nautilus. When I copy files using nautilus file get the group permission 'www-data' as they should. But if I edit a file using Gedit and save it, the file's group get changed to "user" group ?

View 2 Replies View Related

General :: Saving Notes Against A File ?

Sep 22, 2010

I want to save notes against a file on linux... i want to save meta data about a file..because the file names are restricted in max length...So how to save notes or comments about a file on linux so that it gets saved along with the file itself...I used the notes tab in the file properties dialogbox.. but that way the notes stick to the file only on that OS only.. if i open that file in another linux os.. those comments/notes are gone...Way to embedd these notes into the file so that i dont lose them ever..At lease a solution that makes this possible on switching linux distros. if its not portable enough that these notes stick b/w windows and linux its ok for me.. but atleast if i format my linux os.. atleast i shouldnt lose those important notes..and be able to access on newer linux..

And i also have no idea if this notes tab was implemented to be linked with the OS only.. i dont see much use of it.. and a normal user also has noway to know this.. i also came to know on superuser chat from a buddy.. @Sathya ..this thing is more useless especially if u use ubuntu which has 6 months timeline..and crazy people like me who are always eager to upgrade their os as soon a new one is available..and any way i can search these notes from the terminal?

View 3 Replies View Related

General :: F11 - Do Some Operation After Saving File?

Feb 21, 2010

I'm using fedora 11. I want to do some operation like after saving a file (moving ,copying,..) the system need to ask that "DO you want to encrypt?" . If yes I am able to run the crypt module (which I already implemented..). Is it possible to invoke a encrypt module which I implemented in c language.

View 2 Replies View Related

Ubuntu Multimedia :: Saving An Mp3 File From A Webpage's Xml Source Code?

Sep 1, 2010

I listen to a radio show that broadcasts online a lot named ChatterBox Video Game Radio, and when i e-mailed one of the hosts about retrieving archived shows since the site didn't have any archiving of old shows or a link to it. Alon was nice enough to send me one of their old web pages with a HUGE list of archives but it's only the xml source code of the page. since the page isn't live of course, and because of the how he had to send me the code for the page and not a hyperlink to the page, i have the source code. now going through the source code of the page he emailed to me, i can find links to .mp3 files and i can open them and listen to the shows in web browsers, but i was hoping to save them to my computer forfuturelistening.URL]ww.chatterbox'ssite.com/whatever/anotherfolder/showiwanttosave.mp3 in firefox quicktime comes in and lets me listen (as long as my internet connection is active) but wont enable me to save because i dont have the pro version of quicktime. quicktime is good, but i dont use it enough to actually buy the product, and i'm not going to buy the product for just a one time use. is there another way to where i can save this file using the address from the source code (and the ChatterBox allows listeners to save their shows to computer for free, so it not some work around to rob them of money. i fully support them) without having to buy quicktime 7 pro(a product i never really use)?

View 4 Replies View Related

Software :: Saving A Sound File With Bash?

Feb 2, 2011

I wanted to stream audio and save it into a file which I can then listen to at a later date.

Ive found a source that provides a m3u file. Example : [URL]

Is there anyway which I can pipe / save this audio stream into another file using just a standard bash shell.

View 3 Replies View Related

Ubuntu Networking :: Error When Editing/saving An XP File From Karmic Using Gedit?

Jan 2, 2010

I have a new install of Karmic (not an upgrade) on my home network. All the other machines are XP sp2 or sp3. I have the following line in /etc/fstab:

Code:
//desktop/ddrive /home/dram/aDesktop-D cifs credentials=/etc/credentials.dt,nobrl,uid=1001,gid=1001 0 0

[code]....

View 2 Replies View Related

Debian :: Saving Shutdown Text Screen Into A Txt File?

Mar 29, 2010

Is it possible to save all the text appearing once you choose to turn off your debian box into a .txt file for further reading and analysis?

View 2 Replies View Related

General :: Change Thunderbird's File Permissions When Saving Attachments?

Jun 29, 2010

I'm using Thunderbird 3.x on Ubuntu (Linux). When I save an attachment to my computer, the file gets saved with only the owner (me) having read/write permissions. In other words, the file gets saved as -rw

Frequently, I want my group to have permission, or to give read permission to everyone. Is there a way to do change Thunderbird's default file permissions so I don't have to do this manually every time?

View 1 Replies View Related

Server :: Saving A File Removes The Group Execute Permission?

May 23, 2011

Here are some example files that are shared through samba:

-rwxrwx--- user1 group1 file1.txt
-rwxrwx--- user1 group1 file2.txt

When user2 (who is also a member of group1) edits file2.txt the permissions change:

-rwxrwx--- user1 group1 file1.txt
-rwxrw---- user2 group1 file2.txt

user1 then has issues opening the file. This also goes for new files that are created (they are missing the group execute permission).

I have set the option "create mask = 0770" in my smb.conf. Without this set, permissions default to something like -rwxr--r--

View 1 Replies View Related

Programming :: Saving A PPM File - Binary Representation Of Unsigned Chars On The Harddrive

Apr 7, 2010

I am accessing a firewire camera using the libdc1394 library and saving the image as a PPM file, using the code below:

[Code].....

My question is whether the above code is portable. I presume it is, since the result is a binary PPM file which should be capable of being read across multiple computers with different architectures and different operating systems. But at the same time, all that the above code is doing is just saving the binary representation of unsigned chars on the harddrive, and there does not seem to be any reason why the binary representations of the unsigned chars will be identical across multiple computers.

View 1 Replies View Related

Ubuntu :: Pdftk Output File With Pages Extracts Same Size As Input File?

Apr 22, 2011

I am curious if perhaps I am doing something wrong extracting pages from a pdf doc using pdftk and creating a new file. I am only extracting the odd pages from the file and outputting them to a new file that is now only 20 pages instead of the input's 40 pages, yet the new output file is still 1.4Mb in size, the same as the original.

It seems strange to extract only half the pages of a large document and end up with a result that is the same size. how to streamline the resulting pdf's using pdftk?

BTW this is the command I am using, in case perhaps I am missing an option to optimize file size or something:

Code:
pdftk A=ch15.pdf cat A1-40odd output odd.pdf

View 1 Replies View Related

Ubuntu :: Error (splicing File: Input / Output) While Copying File

Jun 3, 2010

When I try to copy PDF files from one folder to another folder, it give me this error: "Error while copying "2004-SNUG-Europe-paper_...log_DPI_with_SystemC.pdf". There was an error copying the file into /media/CCDCE66BDCE64F70/Backup Master/Heterogeneous_cosimulation/Documentation" "Error splicing file: Input/output error" What is the reason of this error and how can this be fixed?

View 9 Replies View Related

Ubuntu :: Copying File - Error Reading From File Input/output

Jun 29, 2010

I have a 7.2 GB file (VMWare virtual machine file) that I am trying to copy from its original location to the another folder OR to external hard drive...each time I try to do this, I always get the following error after the copying process reach 'exactly' 1.4 GB

Error reading from file input/output error

And I have to either Cancel or Skip

I've tried to split the files to smaller pieces but the idea didn't work as I still get the same error whenever I try to compress/ split or do any operation with this file. how I can copy this file?

View 2 Replies View Related

General :: Vim - Avoid Changing A File's Linux Permissions When Saving Over A Samba Connection?

May 28, 2011

I have an Ubuntu development server and a Windows 7 workstation. I use Windows Gvim to edit files on the linux server, over a samba connection.Saving files from Windows change the Linux permissions in weird way depending on the Windows app I'm using and also depending on whether there's a file extension or not.Here are some testsNo extension; Notepad2: 644 to 764

matt@mattserver ~ % ls -l testfile
-rw-r--r-- 1 matt matt 0 2011-05-28 07:09 testfile
--- Save from Windows Notepad2 over network ---

[code]....

View 1 Replies View Related

Programming :: Saving File Data Using Python In An Embedded System In An Safe And Fast Way?

Apr 19, 2011

I am developing a program in a system where the Linux does not take care of the sync command automatically. So I have to run it from my application always I save some data in the disk, which in my case is a 2GB sdcard. It is true that I can make the operation system takes care of the syncronization, using a proper mount option, but in this case the programm's performance drops drastically. In particular I use the shelve module from Python to save data that comes from a socket/TCP connection and I have to deal with the potencial risk of the system being turned off suddenly Initially I wrote something like that to save data using shelve:

Code:

def saveData(vo)
fd = shelve.open( 'fileName' , 'c')
fd[ key ] = vo
fd.close()
os.system("sync")

But that takes too much time to save the data. Note that I use the sync from the OS every time I close a file to prevent data corruption in the case of the "computer" being turned off with data even in the buffer. To improve the performance I made something like that:

Code:

def saveListData( list )
fd = shelve.open('file_name', 'c')
for itemVo in list:
fd[itemVo.key] = itemVo
fd.close()
os.system("sync")

Thus, first I saved an amount of objects in a list then I open the file and save the objects. In this way I have to open the file just one time to save a lot of objects.However I would like to know if adding a lot of objects before closing the file would increase the risk of data corruption.I known that turning off the system after fd.close() and before os.sync may cause problems. But what about turning off the system after

Code:

fd = shelve.open('file_name', 'c')

but before fd.close()?

View 7 Replies View Related

Ubuntu :: Trying To Patch 10.10 I686 - 1 Out Of 1 Hunk FAILED -- Saving Rejects To File Linux-2.6/Documentation/kernel-parameters.txt.rej

Nov 16, 2010

I saw this forum post and I want to try it out so I went here and copied and pasted the following text into a file called test.patch.

Code:
---
Documentation/kernel-parameters.txt | 2
drivers/tty/tty_io.c | 1
include/linux/sched.h | 19 ++++
init/Kconfig | 12 +++
kernel/fork.c | 5 +
kernel/sched.c | 25 ++++--
kernel/sched_autogroup.c | 140 ++++++++++++++++++++++++++++++++++++
[Code]....

1 out of 1 hunk FAILED -- saving rejects to file linux-2.6/Documentation/kernel-parameters.txt.rej I'm not so good with patching so I am sure it is probably something easy.

View 7 Replies View Related

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

General :: Data From Input File To Be Taken And Send To Output File?

Jul 24, 2010

I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:

3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---

[code]...

View 14 Replies View Related

General :: Script To Ftp A File To Remote Machine - Log The Output To A File?

Feb 5, 2010

I am using below script to ftp a file to remote machine

Code:

#!/bin/bash
ftp -nv <<EOF
open ${SERVER}

[code]....

When I execute the above file its working fine and displaying output on to the screen. How can I log the output to a file?

View 7 Replies View Related

Programming :: Sed - Save Output To File With Filename From Content Of Another File?

Feb 28, 2011

My employer issues pdf files with everyones work schedules. I copy the content and save it as plain text in a file called unformatted (hope to be able to automate this step someday). Im working on a SED script that reduces unformatted to only display what I want to see and saves the result in a file Iïve named formatted. After that I have to manually copy formatted and save it with that days date as a filename e.g. 2011-02-25 or whatever day is scheduled in the pdf, for use on a mobile device (Nokia N900). I noticed that the date occurs on certain lines in the file so I added a line like:

sed -n 's/^Date: (201[1-9])/([0-1][0-9])/([0-3][0-9]).*/1-2-3/p' < unformatted >theDate
That creates a file theDate with the date in it that I wish to use as the filename for this particular instance. So I would like to skip the file formatted all together and have the sed- script write to a new file using the content of the Date as a filename, but how do I make that happen? And of course it would be more elegant if I could skip the intermediate theDate file as well.

View 4 Replies View Related

General :: Ubuntu Saving A Scan To "Document" File Using A HP Scanjet 3500c ?

Feb 22, 2010

Request help with scanjet 3500c operation. xSane .996 in Ubuntu sees scanjet and scans. As soon as scan completes, the xSane windows(2) disappears and there are no copies in the intended save folder in Documents. Upon original attempt, the xsane windows had an additional third "Preview" window which has not returned since that first scan attempt?

One is not a computer guru by any imagination!

Info; the scanjet worked very well on the other "doze OS" and seems now, does not in the Ubuntu OS. In Doze, there was also a program for a HP PhotoSmart 3200 running and when I added the scanjet it might have been happy with that driver. Currently I do not have access to the driver disc for the 3200 with me. Too, it now takes ~45+ seconds for the scanjet to begin as compared to 2 - 3 seconds on doze.

Some internet self help searching seems to suggest the xSane 1.0.18 is the driver choice to use with the HP 3500c scanjet. When attempting to download, an archive "Failed" notice appears. I am a bit lost from here.

View 1 Replies View Related

General :: Get Output File From A Master File?

Aug 3, 2010

having following problem in linux environment.I have a following basic file with name " BASEFILE", as shown example below :

sl.no pol.no name status loan
1 123 rama FORCE 500
2 234 jama LAPSE 800

[code]...

View 12 Replies View Related

OpenSUSE Network :: Firefox - "saving Image As" It Fails To Offer "saving Window"?

Feb 4, 2010

Having openSUSE 11.2, Firefox (latest release) is having some issues when comes to "saving image as", it fails to offer "saving window"? Konqueror works normal, what could be the problem with Firefox?

View 4 Replies View Related

Fedora :: Error Saving The Document <filename>: Write Error. The File Could Not Be Written

Jun 5, 2010

I open an ODS file and edit it and save, fine. But sometimes and for no readily apparent reason it refuses to save the document with the error message:"Error saving the document <filename>: Write error. The file could not be written". I have upgraded my version of OpenOffice but the issue remains. Once it starts with that error the only way to save the file is to actually abandon my change and restart OOffice. Today I lost an hours stuff as the auto save was also failing but not giving me any warning it was failing. I'm not sure if this is an OpenOffice, file system, Fedora or permissions issue though I've not noticed anything similar with other applications. Have set permissions to 777 but still get the error.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved