The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Dns Servers vjm AIX 1 03-19-2008 07:45 AM
ksh to run servers pari111222 Shell Programming and Scripting 0 07-24-2007 12:46 PM
Web Servers spiderman UNIX for Advanced & Expert Users 1 11-12-2002 01:28 PM
DNS servers ignus7 UNIX for Dummies Questions & Answers 5 06-19-2002 04:52 PM
name servers rpnhavoc IP Networking 2 02-07-2002 10:24 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-25-2006
Ecclesiastes Ecclesiastes is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 8
Question wc -l across two servers

Hello everyone, I am new to this forum so I dont really know how things work around here in terms of posting questions and getting answers. Anyway I have a question and I hop someone can help.

Here is the scenario. I have a script that counts the amount of lines in serial files as well as multi files using wc -l. The script works perfectly when used on the current server where it is stored but now I have been told that there is a folder with some files that need counting ona remote server. I initially I just wanted to tranfer the script over but because the remote server is the current production server and they dont want anyone messing with it, how can I modify my script to be used across to servers?

below is the script that counts the files on the same server where the count script is:

out=xxx_xxx_dq_counts_check.dat #dat file to store count results
bse=/usr/users/xxx/xxx #base dir
date > $bse/$out #overwrite existing file or create new file
filepath=$bse/$out #assign dir path and filename to variable '$filepath' for easy reference


export basedir1=$xx_xx_xx #where serial files are stored on the local server

if [ -d $basedir1 ] #check to see if dir exists
then
echo "...Starting to process serial files. Please wait...\n"
echo "\n...SERIAL FILES...\n" >> $filepath
for file in `ls -1 $basedir1`
do
cd $basedir1
echo $file #optional to display file currently being processed
wc -l $file >> $filepath #append to file here
done
echo "\n...Serial files processed, now processing multi-files. Please wait...\n"
else
echo Serial Folder $xx_xxx_SERIAL_MONTHLY not found.
echo Serial Folder $xx_xxx_SERIAL_MONTHLY not found. >>$filepath
fi

Now the files I need to look at are on a different server and I have been given a path like the one below:

//Server_Name/usr/users/User_Name/folder1/folder2/folder3/folder4/folder5

and the files whose lines I want to count are in folder 5 and to make matters complicated, I have both serial and Multi-files. I believe m_ls can be used to list the contents of the items in folder 5 on a different server but wc -l will not work. Can anyone help? is it possible to do what I propose to do or should I try something totally different?

thanks, any help will be greatly appreciated. Sorry if I didn't make myself very clear, just ask if you have any Q's

D.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0