Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
how to identify the size of a file
Name: trichyselva Date: August 10, 2006 at 09:00:32 Pacific OS: xp CPU/Ram: p4 Product: pentium
Comment:
i want to know the size of a file and check whether it is empty or not dynamically (through another script) how to write code for it
Name: nails Date: August 10, 2006 at 15:12:38 Pacific
Reply:
Check out the test command:
#!/bin/ksh
myfile="somefile.txt" if [[ -s "$myfile" ]] then echo "$myfile exists and is greater than 0" fi
0
Response Number 2
Name: ghostdog Date: August 10, 2006 at 19:26:55 Pacific
Reply:
you can use wc -c <filename> . It will give the size of the file in bytes.
0
Response Number 3
Name: trichyselva Date: August 10, 2006 at 21:14:54 Pacific
Reply:
alert:
i agree with ur code, it checks if the file is present or not ok how to check if the file is empty or not, even if it is empty or not the file may be present, let me know if i am wrong
Summary: Is there a way to update the contents of a file (this file contains a list of sqls) without piping it to a new file using a shell script ? I have 15 processes reading from a file and I want each of th...
Summary: hi guru,s fo unix! help me out to find the complete/full path of a file present in any directory.I am actually trying to create a script which moves a file along with its complete path to another dire...
Summary: There's a good thought. If no one answers your homework question immediately, post it 10 or 15 more times under different names. Hope that works out for you. BTW you don't need to check for the existe...