Problem with Shell Scripts deleting text in files.
Me and a friend are working on a project, and We have to create a script that can go into a file, and replace all occurances of a certain expression/word/letter with another using Sed. It is designed to go through multiple tests replacing all these occurances, and we don't know what they will be so we have to anticipate anything. We are having trouble on a certain test where we need to replace 'l*' with 'L' in different files using a loop. The code that i have is
I have tried testing this on practice files that contain different words and also 'l*' But whenever i test it, it deletes all the text in the file. Can someone help me with this,
Moderator's Comments:
edit by bakunin: For a number of reasons it is imperative for students posting here to use the template provided. This is not the case here.
I am going to close this thread, please create another thread and fill out the template correctly, i will merge it into this thread here and reopen it.
Last edited by bakunin; 08-15-2012 at 03:26 AM..
Reason: Code tags, please...
Hi everyone,
If someone out there could help me out with this problem. I would really appreciate it.
I am trying to convert a file into xml format using Unix shell scripts.
The file has fields with each field having a certain number of bytes, but the fields are not delimited by anything... (10 Replies)
Hi Gurus!
I wonder if anyone can help me, I'm sure you guys can.
I have a text file which contains a lot of data on the one line as follows:
$
What I need to do is pull all of those id values out (eg 2549425) and write them to a list in a text file.
Any help would be greatly... (3 Replies)
I have a directory full of text data files.
Unfortunately I need to get rid of the 7th and 8th line from them all so that I can input them into a GIS application.
I've used an awk script to do one at a time but due to the sheer number of files I need some kind of loop mechanism to automate... (3 Replies)
Hi all,
I have a directory containing many subdirectories each named like KOG#### where # represents any digit 0-9. There are several files in each KOG#### folder but the one I care about is named like KOG####_final.fasta. I am trying to write a script to copy all of the KOG####_final.fasta... (3 Replies)
Hi Guys,
In one of my folders i have 10000 log files starting with sqlfile.....
Iam trying to delete the log files alone from the folder using for loop but i am getting an error
ksh: /usr/bin/ls: 0403-027 The parameter list is too long.
For loop i used
for i in `ls sqlfile*`... (4 Replies)
I am currently trying out MKS Toolkit C Shell, and I've no problems with it until I try add directories to PATH that are located on a network drive.
When I do that, the shell performance slows down significantly and no longer runs fast. In fact, it takes seconds for something that should take... (1 Reply)
I'm baffled..... the system I work on creates files every Mon-Friday
I'm trying to delete all files older than 30 days old from a Unix prompt, the command I'm using is:
find /directory/ -mtime +30 -exec rm {} \;
however it returns /directory/filename: 644 mode ? (y/n) for every file! ... (1 Reply)
Hi,
does anyone have some of those scripts or maybe have idea how to make them?
------------------------------------
1)
block of text multiplication n times:
e.g.
something1 something2 something3
something4 something5 something6
result:
something1 something2 something3
something4... (2 Replies)
I have 4 files in a directory and want to delete only first 2 files only..
$ ls -ltr
total 640
-rw-r--r-- 1 user other 148779 Oct 12 10:50 file1.xls
-rw-r--r-- 1 user other 148779 Oct 12 10:50 file2.xls
-rw-r--r-- 1 user other 148779 Oct 12 10:50 file3.xls... (4 Replies)
Discussion started by: giridhar276
4 Replies
LEARN ABOUT DEBIAN
cvsmgdiff
CVSMGDIFF(1) Utility Scripts CVSMGDIFF(1)NAME
cvsmgdiff - uses mgdiff to display differences between any two cvs revisions.
SYNOPSIS
cvsmgdiff [-v|-h|-g gui|-r rev1 [-r rev2]] file ...
DESCRIPTION
This manual page documents briefly the cvsmgdiff program. This manual page was written for the Debian GNU/Linux distribution (but may be
used by others), because the original program does not have a manual page.
This script lets you recursively diff the CVS directories you have checked out. To use, just pass in an optional revision levels and an
optional file directory name. This script then will show you the differences you're interested in.
OPTIONS -v Print version information successfully
-h Print help information
-g gui
Use the program gui as the user interface (default: /usr/bin/mgdiff)
-r revision
Specify the CVS revision to view. If just one -r option is given, view differences between that revision and the current file in the
CVS working directory. If two -r options are given, compare those two revisions with each other.
AUTHOR
cvsmgdiff appears to have been written by Paul Serice. This manual page was written by Ian Zimmerman <itz@speakeasy.org> for the Debian
GNU/Linux project, but may be used by others. It was written with the assistance of pod2man(1).
3rd Berkeley Distribution Utility Scripts CVSMGDIFF(1)