![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| number of occurences of a string | siddu_chittari | Shell Programming and Scripting | 12 | 12-04-2006 09:09 PM |
| $A is a number / any other string? How to determine ? | csaha | Shell Programming and Scripting | 2 | 02-21-2006 12:03 AM |
| How to format number/string in ksh | GNMIKE | Shell Programming and Scripting | 2 | 07-03-2005 12:44 PM |
| string to number | George_king | Shell Programming and Scripting | 2 | 09-10-2003 01:48 PM |
| shell to number and to string | xiamin | Shell Programming and Scripting | 1 | 11-06-2001 04:59 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
awk/sed - getting string instead of number
Hi!
I am writing a script handling downloading list of files and I have to check whether file is present locally and if not finished than continue downloading. To do so I have to compare sizes of remote file and local file. To check remote file size I have to parse something like this: Code:
Moon:~ jaja$ curl --cookie /tmp/rpd-cookie.txt -I -L -s http://domain.com/path/to/some/file.zip HTTP/1.1 200 OK P3P: CP="ALL DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONa TELa OUR STP UNI NAV STA PRE" Date: Mon, 24 Mar 2008 07:49:21 GMT Accept-Ranges: bytes Content-Disposition: Attachment; filename=S02E02_20Simpson_20and_20Delilah.mp4 Content-Type: application/octet-stream Content-length: 80566953 Connection: Keep-Alive Code:
REMOTESIZE=`curl --cookie /tmp/rpd-cookie.txt -I -L -s $1 | grep Content-length | awk '{print $2}'`
Anyone could give me some tip? It's bash-script. Thanks hrwath |
| Forum Sponsor | ||
|
|