General :: RPM - Writing Script In Specific File

Apr 11, 2011

Is it possible to write ksh script in the spec file? The target is after I perform
rpm -i my_rpm.rpm
According to the spec file, ksh script will do some installation & configuration. For example run other script and edit some files.

View 1 Replies


ADVERTISEMENT

General :: Writing To A File Using Sed?

Mar 3, 2011

i am having a the following line in a file

<property name="connection.password"></property>

i have to give password in this line, like this

<property name="connection.password">XXXXXX</property>

Is this possible to acheive this using sed command

Beause i have to do this for n number files. so if i have option in sed for this the i will be doing this using script.

View 7 Replies View Related

Fedora Servers :: Writing A Script To Search Through Specific Folders On A Based Server?

Feb 19, 2009

I am thinking about writing a script to search through specific folders on a Linux based server (Centos 5) and report any changes made to any file on that server.Like a detailed change log with the date it was changed and the difference in size. Dose anyone know if such a script exist?

View 2 Replies View Related

General :: Writing Array Into File?

May 3, 2010

How can we write arrayValues in file? Lets say arrayName=(1 2 3 4 5) Now if i want to write these arrayValues into file

In first line in file :1
In second line in file :2
In third line in file :3
In fourth line in file :4
In fifth line in file :5

View 3 Replies View Related

General :: Writing Text To A File?

Mar 18, 2010

I am using Grass GIS

I have written a script which outputs a list of numbers to a file

code snippet:

r.stats -1 fs=, input=Bones_AVE > /home/gary/AVE_monte_carlo/rstats_AVE$i.csv

so this makes acsv file with one column. I want to run it again but rather than outputing to a new csv i want to add it to this one as the next column. For this example there will be 100 rows per column.

the 1st one will make the file

[grassGIS code]> /home/gary/AVE_monte_carlo/rstats_AVE.csv
add ',' after each value
the next one
[grassGIS code] open file /home/gary/AVE_monte_carlo/rstats_AVE.csv

[Code]....

View 1 Replies View Related

General :: Detect If A Program Is Writing To A File?

Mar 3, 2009

I have custom software that writes to a sensitive large file when the user does something. I would like to make backup copies of The file that gets written to, but if I make a gzip of the file at the same time someone is changing something, it will corrupt the backup because some of the data will be missing, as its backed up during being written to.

a) Is there a way to detect if a file is currently being accessed/written to?
That way if its currently being accessed, I can just make the script wait until its done and then finally back it up.

b) Instead of backing up the large file while it has potential to get written to, would it be better to make a copy of the file first, then gzip the copy? This idea comes from the fact that gzipping the original takes 5-10 seconds, whereas making a copy only takes 1-2 seconds. The less time, the less chance of corruption.

c) Is there anyway to freeze a program or a file to stop it from being written to for an amount of time?

With a, b, and c together. The best solution I have to my problem would be a script that first detects rather the file is being accessed. If not, it would then freeze the file/program and then make a quick copy of it. Once the copy is created, it will unfreeze the original file/program and then go about gzipping the copy.

View 3 Replies View Related

General :: RPM + Writing Script In The Spec File?

Feb 23, 2011

is it possible to write ksh script in the spec file? the target is after I perform rpm -i my_rpm.rpm according to the spec file , ksh script will do some installation & configuration for example run other script and edit some files

View 5 Replies View Related

General :: Find Folders With ONLY One Specific File In And Delete File And Folde

Oct 21, 2009

Many folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.

View 5 Replies View Related

General :: Writing A Script To Parse Information From A Text File?

Apr 29, 2011

Go to a specified directory and open a log file and parse out specific information and dump it into another text file.

View 4 Replies View Related

General :: Rename A File By Replacing Specific Letters In The File?

May 11, 2010

I used a script that renamed my file eg 'echo webutil.olb | tr [A-Z] [a-z]' i wanted to rename it back to webutil.olb. How do i do this for many other files that i have

View 3 Replies View Related

General :: Removing Write Permission Does Not Prevent Root From Writing To File

Feb 3, 2010

I just noticed on my Ubuntu machine (ext3 filesystem) that removing write permissions from a file does not keep root from writing to it. Is this a general rule of UNIX file permissions? Or specific to Ubuntu? Or a misconfiguration on my machine? Writing to the file fails (as expected) if I do this from my normal user account.Is this normal behavior?Is there a way to prevent root from accidentally writing to a file (Preferably using normal filesystem mechanisms, not AppArmor, etc.)

I understand that root has total control over the system and can, eg, change the permissions on any file.My question is whether currently set permissions are enforced on code running as root. The idea is the root user preventing her/himself from accidentally writing to a file. also understand that one should not be logged in as root for normal operations.

View 4 Replies View Related

General :: Write File To A Specific Sector?

Jun 28, 2010

I need to copy a file into a Flash memory which is connected to my computer via USB. The file must start at a specific sector.
Can anyone guide me how to do this? (it can be through a C program, a line command, or any other way)

View 8 Replies View Related

General :: File Permission To Specific User?

Jan 13, 2011

i have created a file (by root user) called test.txt. Then i created a user bob. Now i want only bob to read/write/execute this file and no other user shall have any permission on it.

View 3 Replies View Related

General :: Specific File Name Renaming In All Sub Directories?

Apr 4, 2011

I have a dir (pub_html) with 45 sub dirsand in each there is a file with name file123.html) what command can I use to rename all files with this name in all sub dirs to file456.html ? I'm on opensuse 11.3

View 14 Replies View Related

General :: Can Get Version Number Of Tar Used To Create Specific Tar File?

May 19, 2010

I need to know the version number of tar used to create a specific tar file. How can I do that?

View 1 Replies View Related

General :: Showing The Line Count Of A Specific File

Mar 30, 2011

Is this the correct way to show the line count of a specific file?

cat file | grep * -c

View 3 Replies View Related

General :: Recursively Find A .doc File That Contains A Specific Word?

Aug 31, 2011

I'm using bash under Ubuntu.Currently this works well for the current directory:catdoc *.doc | grep "specificword" But I have lots of subdirectories with .doc files.How can I search for, let's say, "specificword" recursively?

View 2 Replies View Related

General :: Command For Finding Specific File Types?

Oct 15, 2009

If there is a command I can use to find specific file types? Say if I want to find all the jpg's in my home folder, but they don't have the .jpg extension in the name, how would I do it? Or can I set some kind of size parameter to find them? The ones I want are all from my digicam and roughly the same size.

View 7 Replies View Related

General :: Cannot Find Specific Glibc Tar File For Editing?

Feb 3, 2011

I have the tar file of glibc-2.12.1, but now I want to edit the SPEC file. I can't find it. For those that want a "why", I'm trying to make it smaller. So simply, where is the SPEC file for glibc? (rpmbuild cannot find it in the *.tar.gz file).

View 4 Replies View Related

General :: How To Find A File With Specific String Inside It

May 7, 2010

Is there any way i can find a file with specific word inside it.For example if i want to find a file which has some text written inside it.How would i form a command to search them?

View 5 Replies View Related

General :: How To Ignore Rows With Specific Character In Csv File?

Mar 11, 2010

I have a csv file that has around 3 million rows. I want to process this file so that it creates a new file that contains only the rows that have 2 characters or less in the first column column.At the moment i am using SQL Loader but its taking too long so im wondering whether this would be easier if done in Unix?

View 8 Replies View Related

General :: Show Specific Lines In A Text File?

Feb 3, 2011

I have created a text file in Linux, and I only want to show certain users. Here is my text file:

usr user tty Limbo?
11 12:06:13 APW no
12 12:06:13 APW no

[code]...

View 12 Replies View Related

General :: Search For A Specific File In The Sysconfig Directory?

Mar 10, 2010

If i am in the root directory and i need to search for a specific file in the sysconfig directory, is there any way to search this directory for a file?

View 10 Replies View Related

Software :: Writing An ISO File For Cd Audio From A Cue And Wave File?

Nov 30, 2008

I am running Intrepid Ibex 64-bit, and I have recently ripped a cd with EAC on one of my windows boxes, and it produced a cue sheet and one single wave file for the entire cd. My question is this, is it possible to take the wave file, burn an ISO image that acts exactly like the original cd? In other words, take the single wave file, using the cue sheet splitting it back into it's individual tracks, and then reading the subsequent ISO image from a program like Sound Juicer, so it can write all the metadata and convert it with my own preferences. I know this is a very strange predicament, but it's one that would save me a world of hassle.

View 5 Replies View Related

General :: Check Quality Of A Specific Column In A Tab-delimited File?

Mar 8, 2010

shell commands for such two goals?

In a tab-delimited file,

Code:
1aIa11aa
2bIIa22aa
1cIIIaabcaa
4dIVaabcaa

1. How can I find the non-unique values in the 1st column (1, in this case)?

2. How can I find the non-integer values in the 5th column (abc, in this case)?

View 3 Replies View Related

General :: Move Folders That Contain A File With A Specific Extension To A Destination Folder?

Oct 3, 2010

Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.

View 2 Replies View Related

General :: Use Symlink To Provide Access To A Specific File Under A Restricted Directory

Jan 24, 2011

My home directory's permissions allow only myself access to it. Is it possible to put a file inside my home directory with.. say.. full permissions, and create a symlink to it so other users can access that file alone inside my home folder? System is Ubuntu Karmic.

View 2 Replies View Related

General :: Bash Script To Parse A File To Get A Set Of Line Between A Specific Characters?

Dec 23, 2010

I have a log file that contains information like this:

----------------------------
r11141 | prasath-palani | 2010-12-23 16:21:24 +0530 (Thu, 23 Dec 2010) | 1 line
Changed paths:
M /projects/
M /projects/

[code]....

what i need is, i need to copy the data given between the "---" to seperate files, for, e.g. the first set of data between the "---" should be in one file and another set of data in another file.

View 5 Replies View Related

General :: How To Make Grep To Search A Pattern In Only Specific File Type?

Mar 6, 2010

To search a string pattern in all files in a directory and subdirectories, I am using;

Code:
grep -R "myclass::my-func(" mydirectory/
Now I want grep, to search in only specific file types say *.cc. Please help me. I have read manual of grep, but could not deduce any hint.
Best Regards.

View 7 Replies View Related

General :: Removing A Line From File Which Is Having Specific Pattern Using Shell Script?

Mar 20, 2011

I'm new to the shell scripting. can any one help in creating shell script for matching the content of the specific variable with file. it should remove that line from the file if line is containing same value as variable and keep the other content as it is.i used grep -v for accomplishing the same. But grep will remove the pattern which is similar.For eg. Assume file "test" contain datas :aaffif i used grep -v command for the pattern "a" to this file this will remove content "aa" from the file. I want the pattern only "a" should remove from the file, if it is existing. otherwise it should throw alert content not exists.

View 5 Replies View Related







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