General :: Why Use Patch Files Based Upon Different When Can Directly Overwrite The Old File With The New File
May 29, 2010
i want to know why do we need to patch files based upon diff when we can directly overwrite the old file with the new file.
View 4 Replies
ADVERTISEMENT
Apr 8, 2011
I just want to upgrade my Slackware 13.1 kernel (2.6.33.4) to the latest stable kernel from kernel.org (2.6.38.2). I have never done anything like this and I am a Linux newbie, so I would appreciate a "Kernel Patching for Dummies" version if possible. I did do a search on this forum and most of what I read was over my head. I found an FAQ on kernelnewbies.org on "How To Apply A Patch" but when I attempted what they suggested, it said it couldn't find the file to patch at line 5 and asked me which file to patch. So I CTRL-Z'd out of there and came here. Here's what I tried:
[code]...
View 14 Replies
View Related
Mar 1, 2011
Asuming I have two files, one large file and one small file, I want to write the smaller file to the large file without overwriting the remaining part of the larger file.
Both are binary files, and the large file can become very large, so I want to avoid copying the whole file, as that will take some time. Is there any standard Linux console utility to do this, or do I need to write it myself?
View 2 Replies
View Related
Jul 12, 2010
We have some large files with sampling data in it. Don't want to delete these files. But want to quickly overwrite the file with 0s and/or 1s and preserve the original file size.
View 3 Replies
View Related
Mar 8, 2011
I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do?
View 2 Replies
View Related
Jan 5, 2010
For example I want a file to be processed by sed, and then overwrite the file with sed's output. I would try this:
Code:
sed '<regex goes here>' myfile > myfile
But it doesn't work as expected, instead it empties the file (I am thinking that as the first byte comes out of sed, it overwrites the whole file and sed has nothing more to do). How can I make this work?
View 14 Replies
View Related
Jan 26, 2009
I'm looking for a tool that can directly convert mp3 file to a swf file. Tried ffmprg - 'ffmpeg -i master.mp3 -ar 22050 -ab 32 -f swf -y -vn new.swf', output is as follows:
Output #0, swf, to 'new.swf':
Stream #0.0: Audio: 0x0000, 22050 Hz, stereo, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec for output stream #0.0
I found a way to perform this task using ffmpeg to convert the mp3 file to a wav file, and converting the wav into a swf file using swftools (wav2swf), although this is not a good option because the output swf file size is very big - for a 12mb input 320kbps stereo mp3 file, the swf file is 25mb. Also downloaded a free direct mp3 to swf conversion software, which had an output swf file - with the same 12mb mp3 file - of ~400kb.
The requirements I have from the tool are:
1. Can be ran from the shell.
2. Direct conversion, or an indirect one that will produce a small output swf file.
3. Suport for multiple file conversion is a plus.
View 6 Replies
View Related
Aug 22, 2010
I want to inplement kgdb on 2.6.27 kernel.over ethernet.. but I am not able to get the patch file for this version.. where I can get patch file for kgdb over ethernet
View 2 Replies
View Related
Apr 12, 2010
I'm writing a bash shell script that among various other things will traverse through a directory with hundreds of files and rename those who match a pattern found in a config file. It's expected that only about one in ten files will actually match, and those who don't, will simply just be ignored for this purpose.
This should for instance cause the file "dBase program file December 1987.prg" to be renamed "Clipper source code December 1987.prg", and conversely "C++ source August 1996.cpp" to be renamed "C source code August 1996.cpp" etc.A sample file such as "Random Data File.dat" should not be renamed here since it's not mentioned in the config file..What is the quickest, most elegant way to do this in bash?I am thinking of using bash's built-in regex matching combined with the /bin/rename utility, but don't quite know how to get started to catch this..I guess there are plenty ways of doing this in perl and elsewhere as well, but since this has to integrate into a pre-existing bash script, that's what I'm looking for.Anyone out there with a spare moment to offer a hint in the right direction?
View 14 Replies
View Related
Mar 8, 2010
When follow the below step for patching the file diff file1 file2 > patchfile.patch patch -p0 file1 < patchfile.patch but I got the following error after that Reversed (or previously applied) patch detected! Assume -R? [n] I dont know what happen here Kernel version is:
2.6.9-89.0.20.ELsmp
patch version is:
patch-2.5.4-20
View 1 Replies
View Related
Apr 30, 2011
I have a bunch of .7z files in a directory, and I need to put each one of them into a separate directory, named after the file (without extention). The command line I use:
Code:
find . -type f | mkdir `sed -e "s:..(.*)...:1:"` ; ls | grep .7z | cp * `sed -e "s:(.*)...:./1/:"`
Copying fails though:
[Code]....
PS. I don't want to use scripts, I want to do it using simple commands and piping.
View 5 Replies
View Related
Sep 28, 2010
I have very little linux experience. And need some help with a bash script. I need to a script I can set cron to run to sort files out of a holding folder into final folders. It doesn't necessarily have to be bash, but I think it would be sufficient for this. File names are formatted as such when created: Dest-Date-Time-CID-Destination# I want the files to be moved from a all in one holding folder to a folder structure like this.
.../storage/year/month/day/Destination#/VarX(type)/hour/CID/'File'
I would need an if/else if/else statement to say if Dest = A set VarX = B If for example the file name was
infinity-20100927-17:00-1112223333-4445556666.wav
I would like the above file to end up moved from
.../holding
to
.../storage/2010/09/27/4445556666/Inbound/17/1112223333/infinity-20100927-17:00-1112223333-4445556666.wav
So the script will need to make directories based on information in the file name which is delimited by single dashes. Then move files from the holding folder to the newly created "sorted" folders.
View 15 Replies
View Related
Jun 25, 2010
I have access to backup server via rsync protocol (only rsync, nothing else). Now, I want to fetch file from there (which is .tar.gz) and pass it directly to tar command, without saving the archive in local filesystem. To visualize, with ssh access I could:
ssh remote_host cat backup.file.tar.gz | tar xzf - And I will get uncompressed backup locally, without actually storing .tar.gz on local machine. Is it possible to achieve when using rsync?
View 4 Replies
View Related
Jul 18, 2011
Is there some way to do live stream video directly from torrent? Are there linux tools like torrent cleint which can do this?
View 3 Replies
View Related
Jul 27, 2010
I am splitting a file based on the values read from an input file. The below one is the script.
1)How do I add the header which is present in the original file to the new split files created?(For eg. pharmacyf conatins header as table column names. The new files created (ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat) are without the header).
2) Also the script is creating 0 byte files for the pharmacyids which are not available in the intial file? Can this be avoided?
for pharmacyf in *
do
tablename=`echo $pharmacyf |cut -f4 -d'.' `
while read pharmacyid
do
grep -w $pharmacyid $pharmacyf >> $OUT/ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat
done< inputfile
done
View 2 Replies
View Related
Jun 10, 2010
when i install ubuntu on vista from iso file directly from hard disk it install the copy completely but after booting up a white sreen comes up with vertical coloured linning.
View 3 Replies
View Related
Mar 18, 2011
Code:
dd bs=8192 if=Image of=/dev/PS0
In the above command, I cant able to understand the option "of=/dev/PS0"
Whether it means,
1) to write the input file "Image" in to "/dev/PS0" of the Floppy device
or
2) to overwrite the same input file "Image" in a file format ("/dev/PS0") of Floppy.
View 2 Replies
View Related
Nov 3, 2010
I work for a company that makes portable devices running Linux and I was recently asked to make the underlying file system read-only for "security" purposes. Since the distribution is based on LinuxFromScratch, I know that very little writing happens at run time. So, even if the device runs on a usb flash device, I doubt that putting the root file system RO will be that beneficial. I am actually more concerned about a process actually breaking because it cannot open a file in RW mode than a process going rogue and filling the root file system with log files, etc. I'd really like to ear what kind of advantages disadvantages there really is with read-only file-systems.
View 6 Replies
View Related
May 11, 2011
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
something like: -printfunction -printername < file*
View 7 Replies
View Related
Jul 28, 2010
I'm getting some funny behavior from ffmpeg when I'm trying to increase the volume of an mp3 file and have it overwrite itself. For example, if I execute the following command:
Code:
ffmpeg -i name.mp3 -vol 1024 -y name.mp3
it will code the first 5 seconds or so and then quit with:
Code:
[mp3 @ 0x2db16d0]incomplete frame
Error while decoding stream #0.0
[Code]....
View 1 Replies
View Related
May 5, 2010
I have written a spec file for packaging my application in an rpm, but it reports a conflict when I am trying to update my service script in /etc/init.d/. This is a file that I do need to update/replace so how might I force the rpm to do that?
Code:
Summary: A program that increases WAN performance.
Name: packetsqueezer
Version: 0.3.05
Release: 1
[code]...
View 3 Replies
View Related
Apr 8, 2010
I am working on the script parsing specific message "TEST" from multiple file. The log file name looks like:
N3.2009-11-26-03-05-02.console.log.tar.gz
N4.2009-11-29-00-25-03.console.log.tar.gz
N6.2009-12-01-10-05-02.console.log.tar.gz
I am using the following command:
zgrep -a --text "TEST" * | awk -F"[ .,]" '{sub(".*:","",$6); sub(",.*","",$7); print $1,$6,$7,$10}
and getting
N3 2009-11-25 20:12:57 TEST
N4 2009-11-28 10:42:18 TEST
N6 2009-12-01 10:00:24 TEST
If I only want to search the log file after 2009-11-29, what shall I change the command?
View 1 Replies
View Related
Nov 5, 2009
I have a file that stores employee login IDs, names, types, and permissions. Our software reads the information based on byte-columns, so it reads a column as any ASCII character (spaces, letters, numbers, punctuation, etc.). I want to create a web-interface for adding and removing users, and storing the data in a MySQL database. However, if I am creating the files from the MySQL output, I need a way to write to specific column locations in the file ...
User ID: Columns 1-4
User Name: Columns 6-30
Type: 32-40
Permissions: 42-45
I want to use a scripting language, preferably C-Shell, to call MySQL for the data and write the data to the correct columns of the file. I wrote a script that takes the data from the file, and dumps it into the MySQL table, so maybe I can pad the remaining space in the table column to fill with spaces ...
View 12 Replies
View Related
Jan 5, 2011
I've recently left Windows behind for good and have come to Linux (Ubuntu.) However, I've run into problems after trying to dual boot windows 7 and ubuntu. When I restarted my computer, I got a black screen with white text reading "Minimal BASH-like line editing is supported". I have the Ubuntu live cd and was able to try Ubuntu without having to install it, but after I put in a flash drive with Windows 7 on it, the Ubuntu CD has stopped working entirely.
The weird thing is, the computer that I installed Ubuntu on, already had Ubuntu and Windows 7 on it. And every OS was booting successfully. The reason I deleted the Ubuntu that was already on the computer, is because there were many different versions. I wanted to do a clean sweep and only have Ubuntu and Windows 7 installed on the computer. I know that if you try to dual boot Windows 7 and Ubuntu, Windows will overwrite the GRUB file, making it unable to dual boot.
View 5 Replies
View Related
Mar 18, 2011
My situation:
Host A: need sudo to access the file
Host B: need sudo to access/overwrite the target file
How to copy a file from host A to host B without creating temporaries? Is it possible?
View 1 Replies
View Related
Jan 30, 2009
I'm not sure if this is possible or even where to start. I assume that this can be done with an sh script using tar or similar.I have several very large zip files that contain images for all of the products in my online store. Each image is named after its 13 digit SKU (for example, 9987788000012.jpg). In order to import products into my store, all images are placed into a media directory. Unfortunately, there are over 100,000 images.
So I would like to break the images into sub-folders based on file name. For example, when I extract store_images.zip (or tar or whatever), my extract script would create directories (if they don't already exist) based on the first three digits of each image name, placing each image into the appropriate bottom level directory. For example, "9987788000012.jpg" would be placed in the following directory "media/9/9/8", with media as the root and "8" as the directory that holds any images that start with "998". Perhaps two sub-folders would be less cumbersome.Assuming this requires a script, particularly since it involves scanning image names, creating folders, and saving images to specific directories, which language would serve my needs best? PHP? Has anyone had to do something similar?
View 13 Replies
View Related
Mar 1, 2011
I have a script: `cd $FILEPATH && patch -i $TMPFILEA2$FILETMPPATH` Variable $FILESPATH is = /tmp/ardiff.AvUUGfOKa2/a/hello/ and Variable $TMPFILEA2$FILETMPPATH is = /tmp/ardiff.AvUUGfOKa2/b/hello/hello.c.patch. I don't know, why is it no working from script file, it write me message to terminal: ./ardiff.sh: line 242: patching: command not found.
But I have no PATCHING command there!!!! The paradox is, when I want to patch it from terminal (I write it to terminal by keyboard, it works).
View 4 Replies
View Related
Apr 15, 2011
I run a command in a Linux terminal, the result was written to the desied folder. After I modified the command and rerun it. The old files are still there and not overwritten at all. Only it is successfull after I deleted the old files and run the command.
View 3 Replies
View Related
Aug 2, 2010
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like
cat "text to add" >> huge_file
To append to the file. Is that the route to go? What about prepending? In general, what is the best route if I wanted to edit somewhere in the middle?
I've tried VIM and it fails miserably. I assume emacs and nano would be even worse. What else is there? I assume to accomplish what I am looking for, the editor would have to be specifically designed for this by not keeping the entirety of the file's contents in memory.
View 5 Replies
View Related
Jan 18, 2010
have a gzip file ABC_000023232.gzipBCD_023232032.gzipI want to split these files into smaller files but keep the extension same because I am using this as a variable in a script
Code:
for i in `ls *.gzip`
split -b 500K $i $i
[code]...
View 3 Replies
View Related