10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a fixed-length positional file. I am trying to replace content of position 4-13 (length=10) with xxxxxxxxxx.
Sample 2 rows in this file:
H0187459823 172SMITH, JOE
H0112345678 172DOE, JANE
In this example 87459823 (from 1st line) and 12345678 (from 2nd line) (both in position... (3 Replies)
Discussion started by: Diver181
3 Replies
2. Shell Programming and Scripting
Hi,
I have a set of files in a directory that I have to read and replace the first occurrence of a number with another dummy number. This is what I have so far but it does not seem to work. The files have lot of other data in each row and each data element is separated by ,@,
for file in... (13 Replies)
Discussion started by: scorpioraghu
13 Replies
3. Shell Programming and Scripting
dear all,
i need your advice
i have sample script like this:
testing.sh
for i in {1..10}
do
echo testing $i
done
but i forgot create "#!/bin/bash" in above "for"
so i want output will like this
testing.sh
#!/bin/bash
for i in {1..10}
do
echo testing $i
done (2 Replies)
Discussion started by: zvtral
2 Replies
4. Shell Programming and Scripting
How to replace the position specific values in the file..
i searched a lot the forums but i couldn't able to do...
i have file like below
576666666666666666666666666 7878 897987 121 0asdas Y12
5900fbb 777 09JJJ 78798347892374 234234234364 234232898
89HJHIHIGIUG989902743748327khjkhkjlh... (6 Replies)
Discussion started by: greenworld123
6 Replies
5. Shell Programming and Scripting
From the existing file, I need to replace specific contents possibly with var every time when the user changes the var.
e.g the contents in the file file.txt is 'My name is $n and I am $y years old' and every time user changed the var outside the file, the contents of the file should be created... (4 Replies)
Discussion started by: Emilywu
4 Replies
6. UNIX for Dummies Questions & Answers
My project is to get a temperature reading from a refridgerator every 2 minutes and check to see if the door has been left open.
I don't yet have the mastery of Linux, being a complete noob, but I reckon I need a text file with the latest temperature reading in it. This I've managed to do by... (2 Replies)
Discussion started by: Fitch
2 Replies
7. Linux
Hello! All,
Could you please tell me how to get a specific line number from a text file?
For example below,
ABC
DEF ---> Get this line number, return to an variable
GHI
My OS is Linux.
Thank you so much for your help in advance! (3 Replies)
Discussion started by: barryxian
3 Replies
8. Shell Programming and Scripting
hey guys,
I have a directory with about 600 files. I need to find a specific word inside a command and replace only that instance of the word in many files. For example, lets say I have a command called 'foo' in many files. One of the input arguments of the 'foo' call is 'bar'. The word 'bar'... (5 Replies)
Discussion started by: ksubrama
5 Replies
9. Shell Programming and Scripting
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies
10. UNIX for Advanced & Expert Users
I want to retain specific number of backup files in a directory.for example i want to retain only two latest backup file in backup directory. If number of backup files is greater than this policy that it will delete oldest file.Please Tell me whether this is possible or not. (2 Replies)
Discussion started by: ranvijaidba
2 Replies