Sponsored Content
Top Forums Shell Programming and Scripting For Loop Range Create Directories Post 302527086 by jaysunn on Thursday 2nd of June 2011 10:26:33 AM
Old 06-02-2011
For Loop Range Create Directories

Hello,
I am a bit stumped on this. I am attempting to create 24 empty directories with a loop. Seems like I have incorrect syntax. When I run the following command I get the error below.

Command
Code:
$ for i in {2..24}; do mkdir $i_MAY_2011 ; done

Error x 24
Code:
mkdir: missing operand
Try `mkdir --help' for more information.

When I run the command as so it works but it creates brackets in the directory name which is unacceptable.

Command
Code:
$ for i in {2..24}; do mkdir {$i}_OPRA_MAY_2011 ; done

Directory Created
Code:
{N}_OPRA_MAY_2011

Would someone please be kind enough to explain what I am doing wrong here?

Thanks,
Jaysunn
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Range specification in for loop

Hello Friends, I want to use range in for loop. For that i used (..) operator but it is not working. Ex: for i in 1..24 do echo $i done Instead of printing 1 to 24 nos, it gives o/p as: 1..24 Please help me Thanks in advance. (2 Replies)
Discussion started by: Niyati
2 Replies

2. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

3. Shell Programming and Scripting

To Create range of values

Hi, I have a file with the below like values with integers only in sorted order (May or may not be in sequence) Eg: File1.txt ----------- 1 2 3 4 5 6 . . . . . 10000 My requirement here is to create a range of values out put to a temp k (4 Replies)
Discussion started by: shiva447
4 Replies

4. Shell Programming and Scripting

Create range from a list

Hello everyone, I am trying to create a script that will make a range or ranges based on a sorted list of numbers. Eg. If the list is like 1 2 3 4 5 6 7 12 13 14 15 The output range should be: 1-7 12-15 (9 Replies)
Discussion started by: run_time_error
9 Replies

5. Shell Programming and Scripting

loop directories mv files to target in range

Hello, Currently I have a painstaking process that I use to move file for a monthly archive. I have to run the same two commands for 24 different directories. I wish to have a script with a for loop automate this and I have not been able to succeed. Here is what I do 24 times. I know this is... (5 Replies)
Discussion started by: jaysunn
5 Replies

6. Shell Programming and Scripting

use variable to set the range of a for loop

Hi; For sure there's an easy answer to this one that I am not finding.. I first set a variable, say b1a:] max=5 then I want to use max to set the range for a for loop like so (it should run for i in 1:5) b1a:] for i in {1..$max}; do echo $i; done {1..5} I would like the output... (2 Replies)
Discussion started by: jbr950
2 Replies

7. Shell Programming and Scripting

How to create individual entries from a range of numbers?

I want to create entries based on the series as in examples below: Input: 2dat3 grht-5&&-15 3dat3 grht-16&&-30 4dat3 ftht-4&&-12 5sat3 ftht-16&&-20 Output: 2dat3 grht-5 2dat3 grht-6 2dat3 grht-7 2dat3 grht-8 (7 Replies)
Discussion started by: aydj
7 Replies

8. Solaris

File System Error: BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DIRECTORIES OUT OF RANGE

Hi All, we are having a file system error in one of our servers. The server failed to boot in usual user mode. Instead boot with single user mode and requesting to run a FSCK manually to repair the corrupted. see the below output. Netra T2000, No Keyboard Copyright 2008 Sun Microsystems,... (5 Replies)
Discussion started by: Buddhike G
5 Replies

9. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

10. Shell Programming and Scripting

TCL script to capture range of lines and create two independent variables

Hi I am having a code as stated below module abcd( a , b , c ,da , fa, na , ta , ma , ra , ta, la , pa ); input a , b, da ,fa , na , ta , ma; output c , ra ,ta , la ,pa ; wire a , b , da , fa ,na , ta , ma; // MBIST Structures... (1 Reply)
Discussion started by: kshitij
1 Replies
NDB_INDEX_STAT(1)					       MySQL Database System						 NDB_INDEX_STAT(1)

NAME
ndb_index_stat - NDB index statistics utility SYNOPSIS
ndb_index_stat options DESCRIPTION
ndb_index_stat ... Usage To obtain basic index statistics about a given NDB table, invoke ndb_index_stat as shown here, with the name of the table as the first argument and the name of the database containing this table specified immediately following it, using the --database (-d) option: ndb_index_stat table -d database In this example, we use ndb_index_stat to obtain such information about an NDB table named mytable in the test database: shell> ndb_index_stat -d test mytable table:mytable index:PRIMARY fragCount:4 sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0 query cache: valid:1 sampleCount:0 totalBytes:0 times in ms: save: 12.380 sort: 0.001 NDBT_ProgramExit: 0 - OK The --verbose option provides some additional output, as shown here: shell> ndb_index_stat -d test mytable --verbose random seed 1337010518 connected loop 1 of 1 table:mytable index:PRIMARY fragCount:4 sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0 read stats query cache created query cache: valid:1 sampleCount:0 totalBytes:0 times in ms: save: 20.766 sort: 0.001 disconnected NDBT_ProgramExit: 0 - OK shell> Options The following table includes options that are specific to the MySQL Cluster ndb_index_stat utility. Additional descriptions are listed following the table. For options common to most MySQL Cluster programs (including ndb_index_stat), see Options Common to MySQL Cluster Programs(1). Table 17.21. ndb_index_stat Options and Variables: MySQL Cluster NDB 7.2 +---------------------------------+--------------------------------------+-------------------------------------+ |Format | Description | Added / Removed | +---------------------------------+--------------------------------------+-------------------------------------+ | | Name of the database containing the | | | --database=name, | table. | All MySQL 5.5 based releases | | | | | | -d | | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Delete index statistics for the | | | --delete | given table, stopping any | All MySQL 5.5 based releases | | | auto-update | | | | previously configured. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Update index statistics for the | | | --update | given table, restarting any | All MySQL 5.5 based releases | | | auto-update | | | | previously configured. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Print the query cache. | | | --dump | | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Perform a number of random range | | | --query=# | queries on first key attr (must be | All MySQL 5.5 based releases | | | int | | | | unsigned). | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Drop any statistics tables and | | | --sys-drop | events in NDB kernel (all statistics | All MySQL 5.5 based releases | | | are | | | | lost) | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Create all statistics tables and | | | --sys-create | events in NDB kernel, if none of | All MySQL 5.5 based releases | | | them | | | | already exist | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Create any statistics tables and | | | --sys-create-if-not-exist | events in NDB kernel that do not | All MySQL 5.5 based releases | | | already exist. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Create any statistics tables or | | | --sys-create-if-not-valid | events that do not already exist in | All MySQL 5.5 based releases | | | the | | | | NDB kernel. after | | | | dropping any that are invalid. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Verify that NDB system index | | | --sys-check | statistics and event tables exist. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Do not apply sys-* options to | | | --sys-skip-tables | tables. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Do not apply sys-* options to | | | --sys-skip-events | events. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Turn on verbose output | | | --verbose, | | All MySQL 5.5 based releases | | | | | | -v | | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Set the number of times to perform a | | | --loops=# | given command. Default is 0. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ ndb_index_stat statistics options. The following options are used to generate index statistics. They work with a given table and database. They cannot be mixed with ndb_index_stat system options. o --database=name, -d name +--------------------+------------------+ |Command-Line Format | --database=name | +--------------------+------------------+ | | -d | +--------------------+------------------+ | | Permitted Values | | +---------+--------+ | | Type | string | | +---------+--------+ | | Default | [none] | | +---------+--------+ | | Range | .. | +--------------------+---------+--------+ The name of the database that contains the table being queried. o --delete +--------------------+-------------------+ |Command-Line Format | --delete | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Delete the index statistics for the given table, stopping any auto-update that was previously configured. o --update +--------------------+-------------------+ |Command-Line Format | --update | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Update the index statistics for the given table, and restart any auto-update that previously configured. o --dump +--------------------+-------------------+ |Command-Line Format | --dump | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Dump the contents of the query cache. o --query=# +--------------------+------------------------+ |Command-Line Format | --query=# | +--------------------+------------------------+ | | Permitted Values | | +---------+--------------+ | | Type | numeric | | +---------+--------------+ | | Default | 0 | | +---------+--------------+ | | Range | 0 .. MAX_INT | +--------------------+---------+--------------+ Perform random range queries on first key attribute (must be int unsigned). ndb_index_stat system options. The following options are used to generate and update the statistics tables in the NDB kernel. They cannot be mixed with ndb_index_stat statistics options. o --sys-drop +--------------------+-------------------+ |Command-Line Format | --sys-drop | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Drop all statistics tables and events in the NDB kernel. This causes all statistics to be lost. o --sys-create +--------------------+-------------------+ |Command-Line Format | --sys-create | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Create all statistics tables and events in the NDB kernel. This works only if none of them exist previously. o sys-create-if-not-exist +--------------------+---------------------------+ |Command-Line Format | --sys-create-if-not-exist | +--------------------+---------------------------+ | | Permitted Values | | +------------+--------------+ | | Type | boolean | | +------------+--------------+ | | Default | true | | +------------+--------------+ | | Range | .. | +--------------------+------------+--------------+ Create any NDB system statistics tables or events (or both) that do not already exist when the program is invoked. o --sys-create-if-not-valid +--------------------+---------------------------+ |Command-Line Format | --sys-create-if-not-valid | +--------------------+---------------------------+ | | Permitted Values | | +------------+--------------+ | | Type | boolean | | +------------+--------------+ | | Default | true | | +------------+--------------+ | | Range | .. | +--------------------+------------+--------------+ Create any NDB system statistics tables or events that do not already exist, after dropping any that are invalid. o --sys-check +--------------------+-------------------+ |Command-Line Format | --sys-check | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Verify that all required system statistics tables and events exist in the NDB kernel. o --sys-skip-tables +--------------------+-------------------+ |Command-Line Format | --sys-skip-tables | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Do not apply any --sys-* options to any statistics tables. o --sys-skip-events +--------------------+-------------------+ |Command-Line Format | --sys-skip-events | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Do not apply any --sys-* options to any events. o --verbose +--------------------+-------------------+ |Command-Line Format | --verbose | +--------------------+-------------------+ | | -v | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Turn on verbose output. o --loops=# +--------------------+------------------------+ |Command-Line Format | --loops=# | +--------------------+------------------------+ | | Permitted Values | | +---------+--------------+ | | Type | numeric | | +---------+--------------+ | | Default | 0 | | +---------+--------------+ | | Range | 0 .. MAX_INT | +--------------------+---------+--------------+ Repeat commands this number of times (for use in testing). COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Oracle Corporation (http://dev.mysql.com/). MySQL 5.5 01/30/2014 NDB_INDEX_STAT(1)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy