Sponsored Content
Top Forums Shell Programming and Scripting Checking the directory and concatenate the data of all the log files in that dir Post 302258747 by anshulinpc on Saturday 15th of November 2008 06:37:48 PM
Old 11-15-2008
Hi,

After reading a bit i have made this script but not sure how far it is right. Please help.

echo $*
INFILE_DIR=$1
INFILE_EXT=$2
cd $XXIPO_TOP
if test -s $INFILE_DIR/*.INFILE_EXT; then
echo " "
echo "*** File Concatenation Started ***"
echo " "
for i in `ls -l $INFILE_DIR/*.INFILE_EXT | awk '{print $9}'
do
cat $i >> targetfilename
done

else
echo "*** File to be imported doesnot exist or has no data ***"
echo $INFILE_DIR/*.INFILE_EXT
exit 1
fi

Thanks.,
Regards,
AS
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Scripting help for rm log files from multiple dir

Hi, I'm quite new to scripting and need some help. I need to have one script that will check specific directories for files older than one month and then have the script delete them. I have written the script below but it only does one directory. I don't quite know how to make it so it... (7 Replies)
Discussion started by: morgadoa
7 Replies

2. Shell Programming and Scripting

home dir checking

Hi, I want suggestion about user home directories, checking. how i could calculate this. I have 200 Users. if home-dir-of-user1 > 250 MB -> print "OK" fi if home-dir-of-user1 > 500 MB > Print "Warning" fi if home-dir-of-user1 > 1000 MB > Print "Critical" fi Thanks, Bash (4 Replies)
Discussion started by: learnbash
4 Replies

3. Shell Programming and Scripting

Checking for proper number of files in dir

Using Solaris 10 and sh. I have three files. mydirs.txt /dir1/dir2/dir3 /dir4/dir5/dir6 mydirshave.txt 1 2 mydirsshouldhave.txt 2 2 For each directory listed in mydirs.txt I should have the number of files equal to mydirshouldhave.txt. But using -ls |wc -l- on the dirs I get what... (2 Replies)
Discussion started by: crowman
2 Replies

4. Shell Programming and Scripting

Checking if the files in a directory have a txt extension

foreach file ($dir1/*) if ($file ~ *.txt) then echo "Skipping $file (is a txt file)" endif end that should work right guys? :confused: (15 Replies)
Discussion started by: pantelis
15 Replies

5. Shell Programming and Scripting

Checking dir and files!

Hi Guys, I wrote a code which checks for the text and directory. If the path is incorrect than it should echo that particular path not found. I can create a different if statments but I want to do this in just one if statment with the use of "or" (||). I have succssfully executed this code but now... (2 Replies)
Discussion started by: dixits
2 Replies

6. Shell Programming and Scripting

List no. of files in a directory/sub dir's and also an consolidated report as required

Need help on below query asap. Thanks. The below is the directory structure: /home/suren under /suren the following are the directories /bin /log /error /bin contains the following files abc.txt bcd.ksh cde.sh wer.ksh ghi (file with out any extension) /log contains the following... (1 Reply)
Discussion started by: sureng
1 Replies

7. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

8. Shell Programming and Scripting

Concatenate 2 files data

Hi, I have one file as: $cat file1 abc pqr 123 def wxy 234 xyz ghi 567 and another file as $cat file2 345 456 987 I want the output of file2 to be appended in file1. And file 1 should look like: $cat file1 abc pqr 123 345 def wxy 234 456 xyz ghi 567 987 (6 Replies)
Discussion started by: Bhrigu
6 Replies

9. Shell Programming and Scripting

Script to keep checking the directory for files.

Hello Folks, Looking for a script which can keep doing ls to the directories and once file landed to the directory then ,read the files do further calculation and exit. Kindly guide. Regards, Sadique (3 Replies)
Discussion started by: sadique.manzar
3 Replies

10. Shell Programming and Scripting

Dig and concatenate all files yesterday then save it to another directory

I dont want to use for loop since it is using a lot of resources especially to a thousand files. Wanting to have a while? or something will find files that has been modifed or created yesteraday. View it. And search for soemthing and save it to a certain folder. for i in `find ./ -mtime... (3 Replies)
Discussion started by: invinzin21
3 Replies
LOCALE_GET_DISPLAY_SCRIPT(3)						 1					      LOCALE_GET_DISPLAY_SCRIPT(3)

Locale::getDisplayScript - Returns an appropriately localized display name for script of the input locale

	Object oriented style

SYNOPSIS
publicstatic string Locale::getDisplayScript (string $locale, [string $in_locale]) DESCRIPTION
Procedural style string locale_get_display_script (string $locale, [string $in_locale]) Returns an appropriately localized display name for script of the input locale. If is NULL then the default locale is used. PARAMETERS
o $locale - The locale to return a display script for o $in_locale - Optional format locale to use to display the script name RETURN VALUES
Display name of the script for the $locale in the format appropriate for $in_locale. EXAMPLES
Example #1 locale_get_display_script(3) example <?php echo locale_get_display_script('sl-Latn-IT-nedis', 'en'); echo "; "; echo locale_get_display_script('sl-Latn-IT-nedis', 'fr'); echo "; "; echo locale_get_display_script('sl-Latn-IT-nedis', 'de'); ?> Example #2 OO example <?php echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'en'); echo "; "; echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'fr'); echo "; "; echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'de'); ?> The above example will output: Latin; latin; Lateinisch SEE ALSO
locale_get_display_name(3), locale_get_display_language(3), locale_get_display_region(3), locale_get_display_variant(3). PHP Documentation Group LOCALE_GET_DISPLAY_SCRIPT(3)
All times are GMT -4. The time now is 02:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy