Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

While 4

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Can somebody help me with a simple request.
I need to check a file size (amount of characters) and if bigger than a certain limit send it of.
I have a function that generates the file which works.
I have a function that sends of the file that works.
But this seems incorrect:

Makefile
a=`wc -m file.txt | awk '{print$1}'`
while [ &quot;$a&quot; < &quot;35&quot; ]
do
MakeFile
done
SendFile
 
BIS try setting a to an integer type first:

typeset -i a

Then remove your quotes from the 35.


Haven't tested this, but give it a go. Cheers.



 
Use &quot;-lt&quot; instead of &quot;<&quot; ...
[tt]
while [ &quot;$a&quot; -lt &quot;35&quot; ]
[/tt]
Otherwise you will get an error like ...
[tt]
sh: 35: Cannot find or open the file.
[/tt]
 
yes exactly - why ?
 

string1 > string2
True, if string1 comes after string2 based on
ASCII value of their characters.



n1 -lt n2 True if the integer n1 is algebraically less than
the integer n2.
vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Many many thanks everybody.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top