我需要输入 CNTRL C 然后我需要输入yes
, 才能接受许可证
现在我正在考虑如何自动化这个过程
我们可以通过运行 sh 脚本并输入CNTRL C
然后输入 yes 来自动化此过程吗?
sh CentOS-7.0.1406.libcurl.20180621.x86_64.sh
LICENSE AGREEMENT FOR ZVELODB SDK LIBRARIES
IMPORTANT, READ CAREFULLY: THIS ZVELODB SDK LIBRARIES LICENSE AGREEMENT
("LICENSE AGREEMENT") IS A LEGAL AGREEMENT BETWEEN YOU (EITHER AN INDIVIDUAL OR
A SINGLE ENTITY, IDENTIFIED HEREIN AS "YOU" OR "YOUR") AND ZVELO, INC.
("ZVELO") FOR THE ZVELODB SDK LIBRARIES ("ZVELODB") AND OTHER PROPRIETARY
SOFTWARE REQUIRED FOR THE PROPER INTEGRATION OF ZVELODB ("ZVELODB SOFTWARE").
ZVELO IS WILLING TO GRANT YOU THE FOLLOWING LIMITED, NON-EXCLUSIVE,
NON-ASSIGNABLE, REVOCABLE LICENSE TO USE THE ZVELODB SOFTWARE ACCORDING TO THIS
AGREEMENT ONLY ON THE CONDITION THAT YOU ACCEPT ALL TERMS IN THIS AGREEMENT.
BY INSTALLING OR USING ZVELO SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THIS
LICENSE AGREEMENT AND THAT YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE
AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE AGREEMENT, ZVELO IS
NOT WILLING TO LICENSE THE ZVELODB SOFTWARE TO YOU AND YOU ARE NOT AUTHORIZED
TO USE THE ZVELODB SOFTWARE.
The zveloDB Software is protected by copyright laws and international copyright
treaties, as well as other intellectual property laws and treaties.
Unauthorized reproduction or distribution is subject to civil and criminal
penalties.
1. GRANT OF LICENSE.
zvelo grants You the right to use the zveloDB Software only in conjunction with
the validly signed Non-Disclosure Agreement (NDA) between zvelo and You.
2. RESTRICTIONS.
You may not use, copy, modify, or transfer the zveloDB Software, or any copy
thereof, in whole or in part, except as expressly provided in this License
Agreement or as defined under a separate zvelo License Agreement. You may not
reverse engineer, disassemble, decompile, or translate the zveloDB Software, or
otherwise attempt to derive the source code, algorithms, or data files of the
zveloDB Software, or authorize any third party to do any of the foregoing. You
may not use data returned ("RESULTS" or "CATEGORIZATIONS" or "META-DATA") from
zveloDB Software to extend or enhance other software or products, unless
otherwise agreed to in writing by an authorized representative of zvelo. You
may not use the zveloDB Software for any software development, application
deployment and/or ultimate production purpose. Except as expressly permitted in
the previous two sentences, any attempt to transfer any of the rights, duties
or obligations hereunder is void. You may not rent, lease, loan, resell for
profit, or distribute the zveloDB Software, its results, or any part thereof
except as expressly provided in this License Agreement or as defined under a
separate zvelo License Agreement. You agree to comply with all applicable laws
regarding the use of the zveloDB Software.
3. YOUR RESTRICTIONS.
You agree:
3.1. to make all payments due to zvelo in a timely fashion;
3.2. to notify zvelo promptly by email at [email protected] if
You suspect unauthorized use of the zveloDB Software and that You
remain responsible for such unauthorized use;
3.3. not to resell, assign, transfer, or delegate this License Agreement
or Your rights or obligations under it without the prior written
consent of zvelo and that any attempt to do such an assignment
without prior written consent is void;
3.4. not to alter the controls of a hard drive or computer system to
enable the use of the zveloDB Software after termination of the
license;
3.5. that You are responsible for the value obtained from Your use of
the zveloDB Software;
3.6. that You will implement or install the zveloDB Software only in an
operating system environment and upon such equipment as approved by
zvelo;
3.7. that You are not a specifically designated individual or entity
under any U.S. (or other) embargo or otherwise the subject, either
directly or indirectly, to any order issued by any agency of the
U.S. Government (or any other government) limiting, barring,
revoking or denying, in whole or in part, Your export privileges
and that You will notify Us immediately in the event You become
subject to any such order;
4. RENEWAL AND TERMINATION.
4.1. Without prejudice to any other rights, this License Agreement will
terminate immediately without notice if you fail to comply with the
terms and conditions of this License Agreement. Upon notice of
termination, you agree to immediately cease all use of the zveloDB
Software and destroy all copies of the zveloDB Software and its
results.
5. OWNERSHIP.
.
.
.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Do you agree with the License? [yes/no]
到目前为止我所做的是:
sh CentOS-7.0.1406.libcurl.20180621.x86_64.sh < < trap ctrl_c INT >/dev/null < <(echo y)
但这种方法不起作用
Perl/python oneliner 行也是预期的
预期结果示例:
Do you agree with the License? [yes/no] yes
Extracting . . .
lib-4.0.20-20180619.x86_64.rpm
lib-devel-4.0.20-20180619.x86_64.rpm
Extract completed. Continue installation by installing the RPM
重要的提示
我能说的是,当我运行脚本并执行 CNTRL C 时,我立即得到关于 yes 的问题
答案1
你可能应该使用expect
对于此类任务。
但是,作为一个快速而肮脏的拼凑,你可以使用script(1)
作为一个迷你期望:
{ sleep .3; printf '\003'; sleep .3; printf 'y\r'; ...other prompt responses...; } |
script -q /dev/null -c 'sh that_installer.sh'
\003
是 Control-C,\r
是 Return/Control-M 等。