Hello,
I have a file named file_1.sh that I want to duplicate into file_2.sh, file_3.sh,..., etc.
I also need to change the text within each file so that it would fit the file name. For example, in file_1.sh there is a command to save some output as 'output_1.txt', and also there is an input range of 1-100.
I have four files that look like this:
file_1:
Code:
a b c
d e f
file_2:
Code:
g h i
j k l
file_3:
Code:
m n o
p q r
file_4:
Code:
s t u
v w x
I would like to write the sum of the 3rd column in each line of every file such that my new output files has 4 columns (4th column similar for all files) as follows:
file_1:
Code:
a b c c+i+o+u
d e f f+l+r+x
file_2:
Code:
When a Linux server is serving many concurrent requests to read many different files, does it:
Seek to File_1, read the entire file, then seek to File_2, read the entire file, then seek to File_3, etc etc
Seek to File_1, read part of it (up to the readahead value?), then seek to File_2, read part of it, then seek back to File_1 where it has left off, read more of it, then seek to File_3, etc, et
Say I have the following structure on path origin_path
origin_path/X=1/B/file_1.txt
origin_path/X=1/B/file_2.txt
origin_path/X=1/B/file_3.txt
...
origin_path/X=2/B/file_1.txt
origin_path/X=2/B/file_3.txt
origin_path/X=2/B/file_3.txt
...
origin_path/X=10/B/file_1.txt
origin_path/X=10/B/file_3.txt
origin_path/X=10/B/file_3.txt
...
...
where there is more than one folder under X=1, X=2, etc.
I assign the variable
Code:
name=`find .
Hello, I have a situation where I want to change a line of text in multiple files, but the problem is that I want to change the text to something unique for each file.
For example, let's say I have five files named bob.txt, joe.txt, john.txt, tom.txt, and zach.txt. Each of these files has a line (1st line) with the text "name = xxx".
Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered.
The script is as follow:
#!/bin/sh
for file in file_1.txt file_2.txt file_3.txt
do
awk '{ print "0" }' $file > tmp.tmp
mv tmp.tmp $file
done
And the cron job I am making is:
*/2 * * * * /root/folder/test.sh
Thanks for the help.
I have a couple of text files
which are named as
Code:
1.txt
2.txt
1000.txt
11.txt
I want to cat/merge the contents of each text file into one single file like this
Code:
1
content of 1.txt
2
content of 2.txt
1000
content of 1000.txt
11
content of 11.txt
I can merge the files and insert a space between the contents of the files using the awk
Code:
awk 'FNR==1{print &
Hi. I have written a simple perl program to add a command to iptables. Here is my code :
Code:
#! /usr/bin/perl
print "Content-type: text/html\n\n";