- 论坛徽章:
- 0
|
原帖由 argstormsky 於 2008-7-7 20:09 發表 ![]()
我的系統是fedora8,用tail命令我加+3選項時.命令會把+3當成一個文件名,而不是實現重第三行打印到最後.
請問你們有這種情況嗎?
tail +3 這個用法已經被廢棄了,因為實際上若檔名真的是 +3 時候不是真的有問題呢 ?
若你要這樣使用,您可以改成相容舊式語法。
- export _POSIX2_VERSION=199209
复制代码
若你要知道明確文件說明,請看這段文件:
- File: coreutils.info, Node: Standards conformance, Prev: Special built-in utilities, Up: Common options
- 2.9 Standards conformance
- =========================
- In a few cases, the GNU utilities' default behavior is incompatible
- with the POSIX standard. To suppress these incompatibilities, define
- the `POSIXLY_CORRECT' environment variable. Unless you are checking
- for POSIX conformance, you probably do not need to define
- `POSIXLY_CORRECT'.
- Newer versions of POSIX are occasionally incompatible with older
- versions. For example, older versions of POSIX required the command
- `sort +1' to sort based on the second and succeeding fields in each
- input line, but starting with POSIX 1003.1-2001 the same command is
- required to sort the file named `+1', and you must instead use the
- command `sort -k 2' to get the field-based sort.
- The GNU utilities normally conform to the version of POSIX that is
- standard for your system. To cause them to conform to a different
- version of POSIX, define the `_POSIX2_VERSION' environment variable to
- a value of the form YYYYMM specifying the year and month the standard
- was adopted. Two values are currently supported for `_POSIX2_VERSION':
- `199209' stands for POSIX 1003.2-1992, and `200112' stands for POSIX
- 1003.1-2001. For example, if you have a newer system but are running
- software that assumes an older version of POSIX and uses `sort +1' or
- `tail +10', you can work around any compatibility problems by setting
- `_POSIX2_VERSION=199209' in your environment.
复制代码
-- |
评分
-
查看全部评分
|