Sponsored Content
Full Discussion: Check wget return code
Top Forums Shell Programming and Scripting Check wget return code Post 302921981 by nimafire on Tuesday 21st of October 2014 12:20:46 PM
Old 10-21-2014
Check wget return code

hello
check this script it jump to else part, in n both cases,
(if files exist or not)

Code:
wget $MIRROR/kkk.zip && wget $MIRROR/jjj.zip
RC="$?"
if [[ "$RC" -ne 1 ]]
then
echo -e "$RED Ooops, Download links are broken...! $RESET"
else
echo -e "$GREEN Everything is fine, Cheers ... $RESET"
fi


Last edited by bartus11; 10-21-2014 at 01:50 PM.. Reason: Please use [code][/code] tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

2. Shell Programming and Scripting

Using wget and check for non-zero files

Hello, I'm using a shell script containing a wget-command that copies html-files from a website to my ISP-server. I therefore want to check if that file exist and also if the filessize is larger than e.g. 100 bytes. Probably it's done by using something like fileexist and filesize. The wget... (3 Replies)
Discussion started by: weatherboys
3 Replies

3. UNIX for Dummies Questions & Answers

to check if file is empty or not and return a non zero value

Hi All, I am new to unix worldd . I need to check a file1 if its empty or not. If its empty then return a non zero value say 99 could you pls let me know the perl script for this. (2 Replies)
Discussion started by: mavesum
2 Replies

4. Shell Programming and Scripting

wget to check an URL

I all, I wrote an script which starts a Weblogic server and waits until its loaded to deploy several apps. The way I checked was something like: while ; do wget --spider <URL>:<port>/console > /dev/null 2>&1 rc=$? done This works perfectly because it's an HTML site and when server is... (2 Replies)
Discussion started by: AlbertGM
2 Replies

5. Shell Programming and Scripting

check if return value is blank

Hi, i am trying to get the no of users using nofActUsers=$(echo /usr/sbin/lsof -l | grep "/mast/data/users" ) it will return blank, if the user does nto have permissions to run the script. Now I need to check if the valueis blank i have route to another script else the user has to... (1 Reply)
Discussion started by: Satyak
1 Replies

6. Shell Programming and Scripting

Find: return code check

Hi, I've a find command like, find /abcd/efgh -name "xxxx" 2> /dev/null > file1 what would be the condition to check if this returns none(means if the file "xxxx" is not present) ???? I tried checking with $? and it returns 72 to me but even the file is present also it returns... (6 Replies)
Discussion started by: skcvasanth
6 Replies

7. UNIX for Dummies Questions & Answers

Problem with wget no check certificate.

Hi, I'm trying to install some libraries, when running the makefile I get an error from the "wget --no check certificate option". I had a look help and the option wasn't listed. Anyone know what I'm missing. (0 Replies)
Discussion started by: davcra
0 Replies

8. Shell Programming and Scripting

Check if wget finishes

how can you check if wget finishes? i have this code to store the source of a website url into a variable: source=$(wget --timeout=15 -qO - $site) but this gets stuck sometimes e.g., one site had a virus and it stopped the script how can i check if wget finishes? i tried to run... (5 Replies)
Discussion started by: vanessafan99
5 Replies

9. UNIX for Advanced & Expert Users

CMD to check status of the server using Wget

Hi All, Using Wget I'm able to get the status of the server.....only when the server is completely down or up.... but problem here in script is Suppose if the server got hang I mean to say that if the server is taking long time to login, for example normally the server takes 3 seconds to login... (3 Replies)
Discussion started by: manohar2013
3 Replies

10. Shell Programming and Scripting

How to return from background process and check if it is running or not?

Hi Team, i am executing 3 scripts in background from 1 script and i want to send a message once the script gets completed.these scripts usually takes 1 hr to complete. My sample script is below, Vi abc.sh sh /opt/data/Split_1.sh & sh /opt/data/Split_2.sh & sh /opt/data/Split_3.sh & ... (3 Replies)
Discussion started by: raju2016
3 Replies
JIGDO-LITE(1)															     JIGDO-LITE(1)

NAME
jigdo-lite - Download jigdo files using wget SYNOPSIS
jigdo-lite [ URL ] DESCRIPTION
See jigdo-file(1) for an introduction to Jigsaw Download. Given the URL of a `.jigdo' file, jigdo-lite downloads the large file (e.g. a CD image) that has been made available through that URL. wget(1) is used to download the necessary pieces of administrative data (contained in the `.jigdo' file and a corresponding `.template' file) as well as the many pieces that the large file is made from. The jigdo-file(1) utility is used to reconstruct the large file from the pieces. `.jigdo' files that contain references to Debian mirrors are treated specially: When such a file is recognized, you are asked to select one mirror out of a list of all Debian mirrors. If URL is not given on the command line, the script prompts for a location to download the `.jigdo' file from. The following command line options are recognized: -h --help Output short summary of command syntax. -v --version Output version number. --scan FILES Do not ask for "Files to scan", use this path. --noask Do not ask any questions, instead behave as if the user had pressed Return at all prompts. This can be useful when running jigdo- lite from cron jobs or in other non-interactive environments. SEE ALSO
jigdo-file(1), jigdo-mirror(1), wget(1) (or `info wget') CD images for Debian Linux can be downloaded with jigdo <URL:http://www.debian.org/CD/jigdo-cd/>. AUTHOR
Jigsaw Download <URL:http://atterer.net/jigdo/> was written by Richard Atterer <jigdo atterer.net>, to make downloading of CD ROM images for the Debian Linux distribution more convenient. 19 May 2006 JIGDO-LITE(1)
All times are GMT -4. The time now is 03:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy