echo

linux jexus 服务 设置开机启动

余生长醉 提交于 2020-01-05 18:21:54
linux的服务开机设置一般在 /etc/init.d/里 而jexus的默认安装目录在 /usr/jexus里 启动文件为 jws 参数 有start stop restart 这里贡献一个刚写好的jexus的开启启动脚本 #!/bin/bash ### BEGIN INIT INFO # # Provides: jws # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: jws # Description: This file should be used to construct scripts to be placed in /etc/init.d. # ### END INIT INFO ## Fill in name of program here. PROG="jws" PROG_PATH="/usr/jexus" ## Not need, but sometimes helpful (if $PROG resides in /opt for example). PROG_ARGS="start" PID_PATH="/var/run

echo. is not working?

≯℡__Kan透↙ 提交于 2020-01-05 14:25:14
问题 I'm creating A Small Program To Help With The Infamous Windows Update Fail in Windows 7! What I'm Using Is A Batch But For Some Reason The "echo." isn't showing blank lines. Any Ideas. Here's my code below @echo off :checkPrivileges NET FILE 1>NUL 2>NUL if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) :getPrivileges if '%1'=='ELEV' (shift & goto gotPrivileges) ECHO. ECHO ************************************** ECHO Invoking Administration Privledges ECHO ************

Linux Bash Shell编程快速入门

空扰寡人 提交于 2020-01-05 12:04:50
BASH 的基本语法 最简单的例子 —— Hello World! 关于输入、输出和错误输出 BASH 中对变量的规定(与 C 语言的异同) BASH 中的基本流程控制语法 函数的使用 2.1 最简单的例子 —— Hello World! 几乎所有的讲解编程的书给读者的第一个例子都是 Hello World 程序,那么我们今天也就从这个例子出发,来逐步了解 BASH。 用 vi 编辑器编辑一个 hello 文件如下: #!/bin/bash # This is a very simple example echo Hello World 这样最简单的一个 BASH 程序就编写完了。这里有几个问题需要说明一下: 一,第一行的 #! 是什么意思 二,第一行的 /bin/bash 又是什么意思 三,第二行是注释吗 四,echo 语句 五,如何执行该程序 #! 是说明 hello 这个文件的类型的,有点类似于 Windows 系统下用不同文件后缀来表示不同文件类型的意思(但不相同)。Linux 系统根据 “#!” 及该字串后面的信息确定该文件的类型,关于这一问题同学们回去以后可以通过 “man magic”命令 及 /usr/share/magic 文件来了解这方面的更多内容。在 BASH 中 第一行的 “#!” 及后面的 “/bin/bash” 就表明该文件是一个 BASH 程序,需要由

Linux安装nginx教程

落花浮王杯 提交于 2020-01-05 00:04:18
#系统选择:centos6.6 一、添加nginx服务进程用户 groupadd -r nginx useradd -r -g nginx nginx 二、下载并解压安装包 wget http://nginx.org/download/nginx-1.9.9.tar.gz tar xvf nginx-1.9.9.tar.gz -C /usr/local/src 三、安装相应开发者工具 yum groupinstall "Development tools" yum -y install gcc wget gcc-c++ automake autoconf libtool libxml2-devel libxslt-devel perl-devel perl-ExtUtils-Embed pcre-devel openssl-devel 四、进入nginx目录进行编译 cd /usr/local/src/nginx-1.9.9/ ./configure \ --prefix=/usr/local/nginx \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log

Windows cmd - Interact with user input prompt [npm] using oneliner

和自甴很熟 提交于 2020-01-04 06:35:21
问题 I am trying to pass in an input as one line to an user-input prompt, but am having difficulty working out how to do it correctly. Specifically I am trying to login to npm using npm adduser ( npm login is its alias) When it's a singular value it works but this only gets me so far: echo exampleuser| npm adduser Username: exampleuser Password: Password: npm ERR! cb() never called! But unfortunately when I try to add multiple commands together it goes awry. Eg: echo 'exampleuser examplepassword

Windows cmd - Interact with user input prompt [npm] using oneliner

蓝咒 提交于 2020-01-04 06:34:26
问题 I am trying to pass in an input as one line to an user-input prompt, but am having difficulty working out how to do it correctly. Specifically I am trying to login to npm using npm adduser ( npm login is its alias) When it's a singular value it works but this only gets me so far: echo exampleuser| npm adduser Username: exampleuser Password: Password: npm ERR! cb() never called! But unfortunately when I try to add multiple commands together it goes awry. Eg: echo 'exampleuser examplepassword

常见 Bash 内置变量介绍

谁都会走 提交于 2020-01-04 03:21:47
目录 $0 $1, $2 等等 $# $* 与 "$*" $@ 与 "$@" $! $_ $$ $PPID $? $BASH $BASH_VERSION $EUID 与 $UID $GROUPS $HOME $HOSTNAME $IFS $PATH $OLDPWD $PWD $PS1 $PS2 $PS4 $0 执行 Bash 脚本时,Bash 会自动将脚本的名称保存在内置变量 $0 中。因为 $0 基于的是实际的脚本文件名称,而不是在脚本中进行硬编码,所以在重命名脚本文件的名称后,不需要修改脚本的内容。比如下面的脚本片段: #!/bin/bash ARGS=3 # 这个脚本需要 3 个参数. E_BADARGS=65 # 传递给脚本的参数个数不对. echo "Args number is : $#" echo $0 if [ $# -ne "$ARGS" ] # 测试脚本的参数个数。 then echo "Usage: $(basename $0) first-parameter second-parameter third-parameter" exit $E_BADARGS fi # 开始干正事儿 在上面的代码中我们使用了 $(basename $0) 的写法,这是因为 $0 会包含脚本文件的路径,为了让输出看起来清爽一些,我用 $(basename $0)

批处理文件应用

徘徊边缘 提交于 2020-01-04 01:46:45
过滤DS生成的pdb文件中的额外信息。拖入生成的pdb文件,自动生成以原文件名加_new结尾的新pdb文件。 @echo off setlocal enabledelayedexpansion set new=%~dpn1_new%~x1 if exist %new% del %new% for /f "delims=" %%i in (%1) do ( set j=%%i if "!j:~,6!"=="HETATM" echo !j!>>%new% if "!j:~,3!"=="END" echo !j!>>%new% ) if %errorlevel% equ 0 (echo OK) else (echo Failed) pause>nul 来源: https://www.cnblogs.com/cp45899/p/12147744.html

Linux高阶命令使用

谁说胖子不能爱 提交于 2020-01-04 00:36:56
1、awk [root@mysql nginx]# cat access.log | awk 'substr($9,1,3)>200' #查看访问日志中,过滤非200状态码的日志请求 # substr($4,20) :表示从第四个字段里的第20个字符开始,一直到设定的分隔符 结束 # substr($4,1,3) :表示从第四个字段里的第1个字符开始,截取3个字符结束 # substr($4,3,6) : 表示从第四个字段里的第3个字符开始,截取6个字符结束 2、getopts getopts指定参数,获取值。同样还有一个作用类似的选项getopt,可以自行百度查看其区别。 [root@mysql nginx]# vim test.sh #脚本内容如下 #!/bin/bash while getopts “:h:p:” optname;do case “$optname” in “h”) host_ip=$OPTARG ;; “p”) host_port=$OPTARG ;; “?” ) echo “不知道此选项” ;; “:”) echo “此选项没有值” ;; “*”) echo “错误信息” ;; esac done echo "IP是${host_ip},端口是${host_port}" #执行效果如下 [root@mysql nginx]# sh test.sh -h

sendmail或mail命令乱码排错

[亡魂溺海] 提交于 2020-01-04 00:13:36
【解决办法】 直接贴出命令。 1 echo “邮件内容” |mail -s “=?UTF-8?B? echo 中文主题 | base64 ?=” 18888668@qq.com – -f user1@test.com 主题前加 1 =?UTF-8?B?`echo #echo前为反引号 主题后加 1 | base64`?= #base64后为反引号 接着再次发送邮件,主题显示正常。 如安装了sendmail会占用25端口产生冲突 service postfix status lsof -i:25 停止sendmail /etc/init.d/sendmail stop 取消自動開機啟動 chkconfig sendmail off 如果没装chkconfig用 sudo systemctl enable sendmail 来源: CSDN 作者: Skywin88 链接: https://blog.csdn.net/Skywin88/article/details/103819820