Sponsored Content
Full Discussion: Curl Loop help
Homework and Emergencies Homework & Coursework Questions Curl Loop help Post 302984935 by balajesuri on Wednesday 2nd of November 2016 09:30:28 PM
Old 11-02-2016
1. To loop over the files matching a particular pattern in a given directory, you can use the for loop construct. For e.g.,
Code:
for file in *.log
do
    sort file | do_something_else >> newfile ## Append output to newfile. >> is the redirection operator (performs an append)
done

2. Also utilities like sort, awk (well, technically awk is not a utility, it's a programming language) can take a filename as argument. So it's a useless use of cat.

Let us know your progress and where you're stuck.
This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

curl

Aren't there any way to download files as below? For example, I want to download all .html files under the root directory of unix.com/ curl -O https://www.unix.com/*.html This won't work, but please tell me the way to do this. Well, the best way is to get the file list of the directory, but i... (6 Replies)
Discussion started by: Euler04
6 Replies

2. AIX

use of curl

Hi guys , need some help I have to transfer a file from my aix box to another server using ftps protocol, how can i achieve this using curl preferably or any other utility. Thanks Sandeep (0 Replies)
Discussion started by: jayawantsandeep
0 Replies

3. Shell Programming and Scripting

use of curl

I have to transfer a file from my aix box to another server using ftps protocol, how can i achieve this using curl preferably or any other utility. Regards Sandeep (0 Replies)
Discussion started by: jayawantsandeep
0 Replies

4. Shell Programming and Scripting

Curl command

Hello, I try to take out of the command curl the info of the time... time curl --write \"Downloaded %{time total}\" -o ...... but having some problem. (1 Reply)
Discussion started by: protocomm
1 Replies

5. Solaris

Curl Installation

Hi, Has anyone installed curl on solaris? I tried installing curl-7.19.4 without any effect. Here's what i have done so far: Copied the package curl-7.19.4-sol8-sparc-local under a certain dir. Tried to add the path in PATH variable. But when I type curl it says bash: curl: command not found.... (2 Replies)
Discussion started by: King Nothing
2 Replies

6. Shell Programming and Scripting

using curl in a script

Hello everyone I'm currently using a script to upload files (different file names, but same date) to an ftp server (see below) #!/bin/sh # Set the variables HOST=<host> USER=<user> PASSWD=<password> ftp -i -n $HOST <<END_SCRIPT user ${USER} ${PASSWD} mput... (0 Replies)
Discussion started by: soliberus
0 Replies

7. Shell Programming and Scripting

Help with cURL

Hi all; first of all i need to clarify that i am new to apache2 server configuration and for some needs i want to transfer some files using curl to web directory,so please bear with me: following is the command i m running to transfer file to my web directory: curl -T "q"... (4 Replies)
Discussion started by: arien001
4 Replies

8. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

9. Shell Programming and Scripting

Loop to curl multiple ips to ipinfo.io

I am rather new to shell scripting and currently taking a linux course. Im having some troubles writing a loop to curl multiple ips in mutiple access logs to the site ipinfo.io and push the output to a text file for easy viewing and removing duplicates. So far i have these simple lines cat... (1 Reply)
Discussion started by: kjcraig77
1 Replies

10. Shell Programming and Scripting

HELP - loop a curl command with different variables from input file

Hi guys! Kind of new to bash scripting and now I'm stuck. I need to curl with these variables: "{ \"nodename\": \"$1\", \"ipaddress\": \"$2\", \"poolname\": \"$3\", \"port\": \"$4\", \"loadbalancer\" : \"$5\" }" and my input_file.txt contains server001 10.10.10.01 serverpool1 80... (4 Replies)
Discussion started by: yort
4 Replies
LDP(7)							 Miscellaneous Information Manual						    LDP(7)

NAME
LDP - Intro to the Linux Documentation Project, with help, guides and documents SYNOPSIS
The Linux Documentation Project (LDP) provides a variety of free documentation resources including guides, FAQs, HOWTOs, and man-pages to the Linux community. AUTHORS
The various documents in the LDP archives are maintained by individual authors, and are listed in the beginning of each HOWTO. If you have any questions or inputs to a document we encourage you to contact the authors directly. WEB PAGES
The LDP has its own dedicated web site as do many of the various translations projects which are linked from the main LDP web site at: http://www.tldp.org/ MAN PAGES
A web page with status information for manual pages and translations is found at: http://www.win.tue.nl/~aeb/linux/man/ MAILING LISTS
LDP has a number of mailing lists, such as <announce@en.tlpd.org> Announcements from the LDP project <discuss@en.tldp.org> General discussion on the LDP project <docbook@en.tldp.org> Questions about the use of DocBook For subscription information, see the website. If you are interested in DocBook beyond the simple markup of your LDP document, you may want to consider joining one of the OASIS DocBook mailing lists. Please see http://docbook.org/mailinglist/index.html for more information. FILES
Most distributions include the HOWTOs and mini-HOWTOs in the installation /usr/doc/ (old place for documentation) /usr/share/doc/ (new place for documentation) /usr/share/doc/HOWTO/ (HOWTO files) /usr/share/doc/HOWTO/mini/ (mini-HOWTO files) SEE ALSO
info(1), man(1), xman(1x) info pages as read with emacs(1) or info(1) LDP
2001-11-15 LDP(7)
All times are GMT -4. The time now is 06:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy