![]() |
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 |
| Replace a filename with full path using sed | aksaravanan | Shell Programming and Scripting | 2 | 10-06-2008 03:49 PM |
| Check valid records in really big file with one commend.. | vtischuk@yahoo. | Shell Programming and Scripting | 3 | 05-18-2008 03:54 PM |
| Remove path from filename | borgeh | UNIX for Dummies Questions & Answers | 3 | 08-23-2007 10:58 AM |
| How to check for a valid numeric input | Vijayakumarpc | Shell Programming and Scripting | 1 | 08-04-2007 08:34 AM |
| how to check the actual path instead of link path | reldb | UNIX for Advanced & Expert Users | 4 | 10-04-2006 09:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
to check whether a directory or filename path is valid or not
the script on excution should take a directory path from useran a numric input and it should check indicate whether its write or not?
if the cmmd sh<script-name>,dir/path.<500>" is greater than 500 in size should be copied to dir ,temp in pwd and display the mesage'files of 2000 bytes hav been copied to dir temp' |
|
||||
|
I'm retyping the question as suggested
Script on execution should take a directory path from user and a numeric input.it should flag in case of input missing or wrong path .All files inside directory greater than a the numeric input specified should be copied to another directory temp .At last the total copied file size in temp should be displayed . |
|
|||||
|
Quote:
Quote:
Quote:
Quote:
|
|
||||
|
is this one?
find $1 -size +$2c ! -type d | xargs ls -l |awk '{print $5}'
find $1 -size +$2c ! -type d | xargs -t -I{} cp {} /temp the above shell can list the size in bytes of all the eligible files in the specified directory. and then write a loop to count the total size. The second command can be used to copy the files to /temp directory. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|