![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating a file | ravisg | Shell Programming and Scripting | 2 | 05-10-2008 06:15 AM |
| checking out latest updated file | asadlone | Shell Programming and Scripting | 3 | 05-08-2008 04:16 AM |
| Creating a csv file based on Existing file | skywayterrace | Shell Programming and Scripting | 3 | 12-02-2007 09:19 AM |
| /etc/utmp file does not get updated with boot up details | jyoti_mil | UNIX for Advanced & Expert Users | 1 | 06-11-2007 10:41 AM |
| which file is updated after modified the crontab entries. | krishna176 | SUN Solaris | 1 | 03-25-2007 02:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Creating an updated file
Hi,
I would like to define a script in order to update a file with the last updated records: I wrote : #!/bin/sh YEAR=$(date +%Y) MONTH=$(date +%m) DAY=$(date +%d) COMM=/usr/bin/comm for file in * ; do if [[ "$file" = DPSTY*_$YEAR$MONTH$DAY* ]] ; then FILE=${DPSTY} UNIQUE=Unique_${FILE} COMMON=Common_${FILE} (${COMM} -3 $FILE $file) > $UNIQUE (${COMM} -12 $FILE $file) > $COMMON cat $UNIQUE $COMMON > $FILE fi done Instead of updating the DPSTY file I got : usage:comm [ -[123] ] file1 file2 usage:comm [ -[123] ] file1 file2 I don't know haw to do it. Thanks |
|
||||
|
Quote:
Thank you. I just have another question : how to easily remove the <tab> character from the result records ? |
|
||||
|
Quote:
It was just : Code:
tr -d '\t' < oldfile > newfile |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|