歡迎您光臨本站 註冊首頁

一個命令seq

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

  $ rpm -qif `which seq`

  Name : coreutils Relocations: (not relocatable)

  Version : 5.2.1 Vendor: Red Hat, Inc.

  Release : 31.2 Build Date: Mon 20 Jun 2005 07:45:58 PM CST Install Date: Fri 06 Jul 2007

  Install Date: Fri 06 Jul 2007 03:30:09 PM CST Build Host: crowe.devel.redhat.com

  Group : System Environment/Base Source RPM: coreutils-5.2.1-31.2.src.rpm

  Size : 7636028 License: GPL

  Signature : DSA/SHA1, Thu 14 Jul 2005 02:52:44 AM CST, Key ID 219180cddb42a60e

  Packager : Red Hat, Inc.

  URL : ftp://alpha.gnu.org/gnu/coreutils/

  Summary : The GNU core utilities: a set of tools commonly used in shell scripts

  Description :

  These are the GNU core utilities. This package is the combination of

  the old GNU fileutils, sh-utils, and textutils packages.

  $ man seq

  SEQ(1) User Commands

  NAME

  seq - print a sequence of numbers

  SYNOPSIS

  seq ... LAST

  seq ... FIRST LAST

  seq ... FIRST INCREMENT LAST

  DESCRIPTION

  Print numbers from FIRST to LAST, in steps of INCREMENT.

  -f, --format=FORMAT

  use printf style. floating-point FORMAT (default: %g)

  -s, --separator=STRING

  use STRING to separate numbers (default: \n)

  -w, --equal-width

  equalize width by padding with leading zeroes

  --help display this help and exit

  --version

  output version information and exit

  If FIRST or INCREMENT is omitted, it defaults to 1. That is, an omitted INCREMENT defaults to 1 even when LAST

  is smaller than FIRST. FIRST, INCREMENT, and LAST are interpreted as floating point values. INCREMENT is usually

  positive if FIRST is smaller than LAST, and INCREMENT is usually negative if FIRST is greater than LAST. When given,

  the FORMAT argument must contain exactly one of the printf-style, floating point output formats %e, %f, %g

  $ cat conn.sql

  #! /bin/bash

  for ((i=1; i<=10; ++i))

  do

  sqlplus scott/xxxx @aa.sql &

  done

  --這樣那個可以寫成

  for i in $(seq 10); do

  sqlplus scott/xxxx @aa.sql &

  done

[火星人 ] 一個命令seq已經有606次圍觀

http://coctec.com/docs/service/show-post-334.html