Sponsored Content
Top Forums Shell Programming and Scripting How to produce a file by many files? Post 302311664 by mingming88 on Wednesday 29th of April 2009 09:28:21 AM
Old 04-29-2009
i got something like this:

Code:
#!/bin/sh

cat Students |while read Student_ID
do 
	for(i=1; i -le 3; i++)
	cat Prac$i |while read ID
		if [ Student_ID -ne ID ]
		then
			if [Student_ID exist in file Missing]
			then
			echo ", Prac$i" >>Missing
			else
			echo "Student_ID: Prac$i" >>Missing
			fi
		fi
done

but it is not working, can someone please change it for me and how can i add things at the end of each line??
Thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk NR==FNR compare 2 files produce a 3rd

hi, i have two files, both with 3 columns, the 3rd column has common values between the two files and i want to produce a 3rd file with 4 columns. file 1 a, ,b c file 2 a, b ,d I want to compare the 3rd value and if a match print to file 3 with the 3 columns from the first file... (11 Replies)
Discussion started by: borderblaster
11 Replies

2. Shell Programming and Scripting

Adding things in a file and produce a new one

I wanna add a ":" at the end of each line, and i did something like this: cat Totals | while read ID TOTAL do echo "${ID}:${TOTAL}:" >>Totals2 done File: Totals 12345678:13 21443433:20 The outputs file Totals2 is: 12345678:13:: 21443433:20:: but i want 12345678:13:... (3 Replies)
Discussion started by: mingming88
3 Replies

3. Shell Programming and Scripting

Perl Script to produce a file

hi i got a file called essay which contain few pages with many paragraphs. now i wanna with PERL to produce another file which called Essaylist that contain a sorted list of words that appear in the file essay. the format for Essaylist: $word found $times times on page a b c.... where $word... (3 Replies)
Discussion started by: mingming88
3 Replies

4. Shell Programming and Scripting

awk to produce zip commands

Hi, I have a list of files which I want to rename and zipped up. The zip file will be split into small files when it contains 500 renamed file. Currently the way i am doing is like this. Get the filenames of the files in a list Generate another list containing the target filenames... (0 Replies)
Discussion started by: Leion
0 Replies

5. Shell Programming and Scripting

simple join for multiple files and produce 3 outputs

sh script file1 filea fileb filec ................filez. >>output1 & output2 &output3 file1 z10 1873 1920 z_number1_E59 z10 2042 2090 z_number2_E59 Z22 2476 2560 z_number3_E59 Z22 2838 2915 z_number4_E59 z1 1873 1920 z_number1_E60 z1 ... (9 Replies)
Discussion started by: stateperl
9 Replies

6. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

7. Shell Programming and Scripting

get file content and produce command

hi buddies; ip.txt: 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 ... parameters.txt: portvalue username password session ... (2 Replies)
Discussion started by: gc_sw
2 Replies

8. Red Hat

how to produce date command o/p

Hello I am trying of a solution to produce date cmnd o/p as: Feb 18 is the 049 day of the year. Any ideas how to produce this? (2 Replies)
Discussion started by: ranumala
2 Replies

9. UNIX for Advanced & Expert Users

gzip vs pipe gzip: produce different file size

Hi All, I have a random test file: test.txt, size: 146 $ ll test.txt $ 146 test.txt Take 1: $ cat test.txt | gzip > test.txt.gz $ ll test.txt.gz $ 124 test.txt.gz Take 2: $ gzip test.txt $ ll test.txt.gz $ 133 test.txt.gz As you can see, gzipping a file and piping into gzip... (1 Reply)
Discussion started by: hanfresco
1 Replies

10. Shell Programming and Scripting

Join two files combining multiple columns and produce mix and match output

I would like to join two files when two columns in each file matches with each other and then produce an output when taking multiple columns. Like I have file A 1234,ABCD,23,JOHN,NJ,USA 2345,ABCD,24,SAM,NY,USA 5678,GHIJ,24,TOM,NY,USA 5678,WXYZ,27,MAT,NJ,USA and file B ... (2 Replies)
Discussion started by: mady135
2 Replies
Error(3pm)						User Contributed Perl Documentation						Error(3pm)

NAME
APR::Request::Error - wrapper for libapreq2's error API. SYNOPSIS
use APR::Request::Error; DESCRIPTION
This manpage documents version 2.13 of the APR::Request::Error package. SUBROUTINES
APR::Request::Error - derived from "APR::Request" and "APR::Error". strerror strerror($status) Returns the apreq error string associated with a numeric $status code. ERROR CONSTANTS
GENERAL Internal apreq error TAINTED Attempt to perform unsafe action with tainted data BADDATA Malformed input data BADCHAR Invalid character BADSEQ Invalid byte sequence BADATTR Unrecognized attribute BADHEADER Malformed header string NODATA Missing input data NOTOKEN Expected token not present NOATTR Missing attribute NOHEADER Missing header NOPARSER Missing parser MISMATCH Conflicting information OVERLIMIT Exceeds configured maximum limit NOTEMPTY Setting already configured SEE ALSO
APR::Request, APR::Error COPYRIGHT
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. perl v5.10.1 2011-02-28 Error(3pm)
All times are GMT -4. The time now is 10:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy