Sponsored Content
Top Forums Shell Programming and Scripting "Command not found" doing a while loop in bash/shell Post 302772441 by phpchick on Monday 25th of February 2013 03:16:08 PM
Old 02-25-2013
"Command not found" doing a while loop in bash/shell

Code:
i=0
numberofproducts=${#urls[@]}  #gets number of entries in array called "urls"
numberofproductsminusone=`expr $numberofproducts - 1`   #-subtract by one

while [$i -lt $numberofproducts]
do
	wget ${urls[$i]}
	 i=$(( $i + 1 ))
	sleep 10
done


I'm getting an error

./scrape: line 22: [0: command not found


that line corresponds with the "while" line.

Could anyone help me with this ? I googled but none of the examples I found were relevant to this.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"-bash: sqlldr: command not found"

hi all, here i am trying to run one control file. but getting "-bash: sqlldr: command not found" error :confused: the code is given below. sqlldr $db_username/$db_password@$db_sid control=$loading_path/load_to_table.ctl log=loading.log can anybody help me in fixing the issue? ... (1 Reply)
Discussion started by: vinayakatj56
1 Replies

2. Shell Programming and Scripting

How to distinguish between "command not found" and "command with no result"

system() call imeplemented in solaris is such a way that: Command not found - return code 1 Command executed successfully without Output - return code 1 how to distinguish between these two based on return code in a c - file? Can you help on this ? (5 Replies)
Discussion started by: iitmadhu
5 Replies

3. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

4. Post Here to Contact Site Administrators and Moderators

What's happens with my thread about "-bash: ELF: command not found "?

Hi, Today, I've submitted a new tread in "Shell Programming and Scripting" forum, with title "-bash: ELF: command not found ". However, this thread has disappear. Can somebody give me an explanation? Regards. (3 Replies)
Discussion started by: Sonia_
3 Replies

5. UNIX for Dummies Questions & Answers

BASH: Interactive "cp" (and "mv") in a loop

Hi. I have a copy-file script (and a move-file script) that I recently tried to make interactive. I tested the former on three files from a text list, and watched to see what would happen. As the cp command was in a while/do/done loop, there was no pause for input: it wrote the file from the... (2 Replies)
Discussion started by: SilversleevesX
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Bash Script giving "Command Not found"

Hello Geeks, Greetings...I have the following script: #!/usr/bin/bash #Script to generate number of active PDP context & calculate PDP activation #failurefrom EPG-M #Script written by Gbenga Adigun #September 12, 2013 username="xxxxxx" password="xxxxxxxxx" HOSTS=( ggsn01... (6 Replies)
Discussion started by: infinitydon
6 Replies

8. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

10. UNIX for Beginners Questions & Answers

Query on using command "sed" for replacing text in bash shell

Re: Query on using command "SED" for replacing text in bash shell While using the command "sed" for find and replace, I wanted to know how one could find a constant and replace it with a variable inside the quotation syntax of sed? I wanted to replace constant 3 with variable name... (3 Replies)
Discussion started by: achandra81
3 Replies
PHATCH(1)						      General Commands Manual							 PHATCH(1)

NAME
Phatch - Photo Batch Processor DESCRIPTION
Phatch is a simple photo batch processor. It handles all popular image formats and can duplicate (sub)folder hierarchies. It can also batch resize, rotate, rename, ... and more in minutes instead of hours or days if you do it manually. SYNOPSIS
Phatch [actionlist] Phatch [options] [actionlist] [image folders/files/urls] Phatch --inspect [image files/urls] Phatch --droplet [actionlist/recent] [image files/urls] OPTIONS
--version Show program's version number and exit. -h, --help Show the command line options which are accepted by Phatch -c, --console Run Phatch as console program without a gui -d, --droplet Run Phatch as a gui droplet --desktop Save always on desktop -f, --force Ignore errors --fonts Initialize fonts (only for installation scripts) -i, --interactive Interactive -k, --keep Keep existing images (don't overwrite) -l LOCALE Specify locale language (for example en or en_GB) -n, --inspect Inspect metadata (requires exif & iptc plugin) --no-save No save action required at the end -r, --recursive Include all subfolders -t, --trust Do not check images first --unsafe Allow Geek action and unsafe expressions -v, --verbose Verbose EXAMPLES
phatch action_list.phatch phatch --verbose --recursive action_list.py image_file.png image_folder phatch --inspect image_file.jpg phatch --droplet recent phatch -l el AUTHOR
Stani (spe.stani.be (at) gmail.com) User Commands February 2009 PHATCH(1)
All times are GMT -4. The time now is 06:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy