亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2199 | 回復: 3
打印 上一主題 下一主題

[文本處理] typeset無法使用 [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2014-09-28 11:47 |只看該作者 |倒序瀏覽
  1. #!/bin/bash
  2. typeset -R8 a="asdasd"
  3. b="asdas"
  4. echo "$a$b"
復制代碼

結果提示我typeset:-R :無效選項,各位大俠,這是怎么回事?
其實我一行是顯示多個變量,我想第一個變量和第二個變量都是長度不足10,自動補全,可有其他方法達到目的?
謝謝了

論壇徽章:
0
2 [報告]
發(fā)表于 2014-09-28 12:26 |只看該作者
有人不?我的系統(tǒng)是Ubuntu12.04

論壇徽章:
145
技術圖書徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11獅子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龍
日期:2014-01-08 15:26:12技術圖書徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
3 [報告]
發(fā)表于 2014-09-28 12:53 |只看該作者
本帖最后由 jason680 于 2014-09-28 12:55 編輯

回復 1# mcskyding


>>其實我一行是顯示多個變量,我想第一個變量和第二個變量都是長度不足10,自動補全,可有其他方法達到目的?

How to 補全? Would you please to give a example?


There is no -R argument in typeset

$ man bash
  ...
       declare [-aAfFgilrtux] [-p] [name[=value] ...]
       typeset [-aAfFgilrtux] [-p] [name[=value] ...]
              Declare  variables and/or give them attributes.  If no names are
              given then display the values of variables.  The -p option  will
              display the attributes and values of each name.  When -p is used
              with name arguments, additional options are ignored.  When -p is
              supplied  without name arguments, it will display the attributes
              and values of all variables having the attributes  specified  by
              the  additional  options.  If no other options are supplied with
              -p, declare will display the attributes and values of all  shell
              variables.   The  -f  option  will restrict the display to shell
              functions.  The -F option inhibits the display of function defi‐
              nitions;  only the function name and attributes are printed.  If
              the extdebug shell option is enabled  using  shopt,  the  source
              file name and line number where the function is defined are dis‐
              played as well.  The -F option implies -f.  The -g option forces
              variables  to  be  created or modified at the global scope, even
              when declare is executed in a shell function.  It is ignored  in
              all  other cases.  The following options can be used to restrict
              output to variables with the  specified  attribute  or  to  give
              variables attributes:
              -a     Each  name  is  an  indexed  array  variable  (see Arrays
                     above).
              -A     Each name is an associative array  variable  (see  Arrays
                     above).
              -f     Use function names only.
              -i     The variable is treated as an integer; arithmetic evalua‐
                     tion (see ARITHMETIC EVALUATION above) is performed  when
                     the variable is assigned a value.
              -l     When  the  variable  is  assigned a value, all upper-case
                     characters are converted to lower-case.   The  upper-case
                     attribute is disabled.
              -r     Make names readonly.  These names cannot then be assigned
                     values by subsequent assignment statements or unset.
              -t     Give each name the  trace  attribute.   Traced  functions
                     inherit  the  DEBUG  and  RETURN  traps  from the calling
                     shell.  The trace attribute has no  special  meaning  for
                     variables.
              -u     When  the  variable  is  assigned a value, all lower-case
                     characters are converted to upper-case.   The  lower-case
                     attribute is disabled.
              -x     Mark  names  for  export  to  subsequent commands via the
                     environment.

              Using `+' instead of `-' turns off the attribute  instead,  with
              the exceptions that +a may not be used to destroy an array vari‐
              able and +r will not remove the readonly attribute.   When  used
              in a function, makes each name local, as with the local command,
              unless the -g option is supplied, If a variable name is followed
              by  =value,  the  value  of  the  variable is set to value.  The
              return value is 0 unless an invalid option  is  encountered,  an
              attempt  is  made  to define a function using ``-f foo=bar'', an
              attempt is made to assign a value to  a  readonly  variable,  an
              attempt  is  made to assign a value to an array variable without
              using the compound assignment syntax (see Arrays above), one  of
              the names is not a valid shell variable name, an attempt is made
              to turn off readonly status for a readonly variable, an  attempt
              is  made  to  turn off array status for an array variable, or an
              attempt is made to display a non-existent function with -f.

論壇徽章:
0
4 [報告]
發(fā)表于 2014-09-28 12:58 |只看該作者
回復 3# jason680


    謝了,我用awk解決了
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP