Could you please try following and let me know if this helps. 1st approach:
So above approach will create always line which have Gateway in it to file name test1 and so on always, if you want to append the data(let's say you have multiple line like you shown into your Input_file) then you could change > to >> to append it in above code.
2nd approach:
If any string is NOT present in a Input_file then it will NOT increase the value of variable I, so let's say Gateway line is going to file named test1 and then Netmask should go to test3 BUT if in between IP_Address is not found then Netmask one will go to test2 then.
3rd approach:
Let's say your Input_file have multiple occurrences of strings which you have mentioned above and you want to keep the files from test1 to test6 only so this code will help you to do so and it will keep appending the lines into their respective files.
Hello,
I have 50 text files in a directory called "AllFiles"
I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and... (7 Replies)
I have some html with hrefs that contain local links to pdf filenames. These filenames should have standardised names, i.e. there should be a label prior to the ".pdf" filename suffix. There can be many of these links on a single line of text and some may already have the label. For example
... (13 Replies)
Hi,
I'm trying to write a bash script that takes a file and passes each line from the file into an array with elements separated by column.
For example:
Sample file "file1.txt":
1 name1 a first
2 name2 b second
3 name3 c third
and have arrays such as:
line1 = ( "1" "name1" "a"... (3 Replies)
Task: Find keywords in each line, and append at the end of line; if not found in the line, do nothing.
the code is wrong. how to make it work. thanks a lot.
cat keywords.txt | while read line; do
awk -F"|" '{if (/$line/) {print $0"$line , ";} else print;}' outfile.txt > tmp
... (9 Replies)
Hi,
I need help to match two files based on two columns.
file_1
ID AA An Ca Ele Pro Su Ot Tra
g13950 No No Yes No Yes Yes Yes Yes
g05760 Yes No No No No Yes Yes Yes
g12640 No No No No No No No No
k17720 No Yes No No No No No Yes
g05640 Yes Yes Yes No No Yes Yes Yes
file_2
... (8 Replies)
Hi frnds,
My requirement is I have a zip file with name say eg: test_ABC_UH_ccde2a_awdeaea_20150422.zip
within that there are subdirectories on each directory we again have .zip files and in that we have files like mama20150422.gz and so on.
Iam in need of a bash script so that it unzips... (0 Replies)
I have ~100 text files in a directory that I am trying to parse and output to a new file. I am looking for the words chr,start,stop,ref,alt in each of the files. Those fields should appear somewhere in those files. The first two fields of each new set of rows is also printed. Since this is on a... (7 Replies)
I'm working on a bash script to finish uploading a file.
I need a way to get $filesize so that "restart $filesize" will work.
Here is my script:
ftp -n -v <<END_SCRIPT
open ftp.$domain
user $user@$domain $password
size $file
restart $filesize
put $file
quit
END_SCRIPTWayne Sallee... (9 Replies)
Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames?
AAAL_555A_ORANGE1_F190404.TXT
AAAL_555A_ORANGE2_F190404.TXT
AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
The bash stores each uniqueid in an array and then passes them to %q to get the unique path. That seems to work what I am having trouble with is renaming each .png with the unique value in %q. I thought it was working but upon closer inspection, a .png file is being sent to scp.... but only 1 and... (21 Replies)
Discussion started by: cmccabe
21 Replies
LEARN ABOUT MINIX
pbmpage
pbmpage(1) General Commands Manual pbmpage(1)NAME
pbmpage - create a one page test pattern for printing
SYNOPSIS
pbmpage [-a4] test_pattern
DESCRIPTION
pbmpage generates a one page test pattern to print on a sheet of paper, for use in calibrating a printer. The test pattern in is PBM for-
mat.
pbmpage produces an image intended for 600 dots per inch printer resolution.
If you are printing on an HP PPA printer, you can convert the output of this program to a stream that you can feed to the printer with pbm-
toppa.
Bear in mind that when you print the test pattern, you are testing not only the printer, but any converter or driver software along the
printing path. Any one of these components may adjust margins, crop the image, erase edges, and such.
If, due to addition of margins, the printer refuses to print the image because it is too big, use pnmcut to cut the right and bottom edges
off the test pattern until it is small enough to print.
test_pattern is the number of the test pattern to generate, as follows. The default is 1.
1 A grid ruled in numbers of pixels. The outermost rules are exactly at the edges of the paper.
2 A vertical line segment, one pixel wide, extending 1/2" up from the exact center of the page.
3 Two diagonal line segments, one starting at the upper left corner of the page, the other starting from the lower left corner of the
page. Both extend 1/2" toward the center of the page at 45 degrees.
OPTIONS -a4 Generate an image for A4 (European) paper. Without this option, pbmpage generates an image for US standard paper (8 1/2" wide x 11"
high).
SEE ALSO pbmtoppa(1), pnmcut(1), pbm(5)AUTHOR
Tim Norman. Copyright (C) 1998. Licensed under GNU Public License
Manual page by Bryan Henderson, May 2000.
01 May 2000 pbmpage(1)