10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi guys!
I have quite a lot of files like
all_10001_ct1212307460308.alf*
and I want to get rid of the first number for all at once like:
all_ct1212307460308.alf*
How can I do this in the shell? (12 Replies)
Discussion started by: TimmyTiz
12 Replies
2. Shell Programming and Scripting
Hi all,
I need to replace a line
export TZ=xxxxxxxx
with the line
export TZ=$1
Now, "xxxxxxxx" in the above line is some unknown string and $1 is a parameter. I want the content of $1 to be replaced with "xxxxxxxx".
Kindly help me how to do this in the shell scripting. (5 Replies)
Discussion started by: ddeeps2610
5 Replies
3. Shell Programming and Scripting
I have a file which has a list in it
pop
triangle
people
slow
fast
What I want to do is search this list and replace people with humans do the list looks like this:
pop
triangle
human
slow
fast
I think i use something like this....
if cat /list.txt | grep -q 'people' ; then (9 Replies)
Discussion started by: digitalviking
9 Replies
4. Shell Programming and Scripting
Hi All,
As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2
e.g.
file 1
wqwert
4.4464002
3
319
286
369
46.320002
56.150002
45.100002
1
1
1
0.723 (12 Replies)
Discussion started by: f_o_555
12 Replies
5. Shell Programming and Scripting
Hi,
I am a relative new bee in scripting. I need to develop a script such that the code would iterate through each file in a source directory and append every line of the file with '|' and the corresponding file filename.
eg
INPUT file IF927_1.dat -
H|abc... (4 Replies)
Discussion started by: scripting_newbe
4 Replies
6. UNIX for Dummies Questions & Answers
I am trying to find a way to create a script which will extract the first line of a file and then rename the file (or create a new file with the same content as the old file) using the first line as the name. The first line being a single word, that is. I am hopeless at programming, if anyone can... (5 Replies)
Discussion started by: s.plumb
5 Replies
7. Shell Programming and Scripting
Hello,
I have a csv file and will like to replace the last character of each line in the file with Z (20 Replies)
Discussion started by: 123script
20 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I've recently run a script that inserts the filename into all files of my active directory. Now I want to move the filename string and have it replace text a few lines down.
In other words, here's what I'm trying to do. Here is a file called 'goodtimes':
"
goodtimes
Hi, Welcome... (1 Reply)
Discussion started by: calrog
1 Replies
9. Shell Programming and Scripting
I have a problem in the following code ...
while read line
do
#Get Line Number
OLDLINE=`sed -n $Lineno $filename`
echo "Un Changed Line : "$OLDLINE
echo "Enter a New Pattern : "
read NewPattern <&1
echo "NewPattern :"$NewPattern
NEWLINE=`cat $filename | sed -n... (1 Reply)
Discussion started by: maxmave
1 Replies
10. UNIX for Advanced & Expert Users
hey guys, how do i replace only a line within a file without messing up the rest of the contents of the file?
see, if possible can you guys give me a straight forward way to do this. i dont want a complex command. what i mean is i know i can accomplish this by using sed, well, i think i can,... (3 Replies)
Discussion started by: Terrible
3 Replies