![]() |
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 |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 | ||
|
|