What's a .sh file?

后端 未结 6 514
礼貌的吻别
礼貌的吻别 2020-12-12 11:11

So I am not experienced in dealing with a plethora of file types, and I haven\'t been able to find much info on exactly what .sh files are. Here\'s what I\'m tr

6条回答
  •  情深已故
    2020-12-12 11:32

    If you open your second link in a browser you'll see the source code:

    #!/bin/bash
    # Script to download individual .nc files from the ORNL
    # Daymet server at: http://daymet.ornl.gov
    

    [...]

    # For ranges use {start..end}
    # for individul vaules, use: 1 2 3 4 
    for year in {2002..2003}
    do
       for tile in {1159..1160}
            do wget --limit-rate=3m http://daymet.ornl.gov/thredds/fileServer/allcf/${year}/${tile}_${year}/vp.nc -O ${tile}_${year}_vp.nc
            # An example using curl instead of wget
        #do curl --limit-rate 3M -o ${tile}_${year}_vp.nc http://daymet.ornl.gov/thredds/fileServer/allcf/${year}/${tile}_${year}/vp.nc
         done
    done
    

    So it's a bash script. Got Linux?


    In any case, the script is nothing but a series of HTTP retrievals. Both wget and curl are available for most operating systems and almost all language have HTTP libraries so it's fairly trivial to rewrite in any other technology. There're also some Windows ports of bash itself (git includes one). Last but not least, Windows 10 now has native support for Linux binaries.

提交回复
热议问题