[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 请问怎么把上一次命令输出内容赋值给变量?

<head>
<meta name="keywords" c />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="Bookmark" href="/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <link rel="stylesheet" type="text/css" href="css/all.css" />
    <script src="files/jquery.js" type="text/javascript"></script>
    <script src="files/Public.js" type="text/javascript"></script>
    <script src="files/mall.js" type="text/javascript"></script>
    <script type="text/javascript">
</head>

--------------------------------------------------------------------------------
我使用 find 小工具进行正则匹配找到上面2个css文件名
  1. @echo off
  2. f index.html -r:"***:\w+\.css" -o:"k"
复制代码
我本来的想法是用 for 什么的把上面输出的结果,(但不知道怎么样操作上一条命令输出的结果。)
index.css
all.css
重新组合做成
    <link rel="stylesheet" type="text/css" href="cmspath/index.css" />
    <link rel="stylesheet" type="text/css" href="cmspath/all.css" />
然后添加到</head>的前面,即

---------------------------------------------------------------------------------
<head>
<meta name="keywords" c />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="Bookmark" href="/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <link rel="stylesheet" type="text/css" href="css/all.css" />
    <script src="files/jquery.js" type="text/javascript"></script>
    <script src="files/Public.js" type="text/javascript"></script>
    <script src="files/mall.js" type="text/javascript"></script>
    <script type="text/javascript">
    <link rel="stylesheet" type="text/css" href="cmspath/index.css" />
    <link rel="stylesheet" type="text/css" href="cmspath/all.css" />
</head>
---------------------------------------------------------------------------

[ 本帖最后由 linjuming 于 2009-8-18 16:47 编辑 ]

返回列表