zoukankan      html  css  js  c++  java
  • shell常见报错

    1.[root@web01 scripts]# cat -A nginx.sh |head -6 脚本特殊符号#!/bin/bash^M$HOST="127.0.0.1"^M$
    PORT="80"^M$
    stub_status=nginx_status^M$
    pidof_addr=`which pidof`^M$
    function check() {^M$

    window格式转换
    yum install dos2unix.x86_64 -y &>/dev/null 安装dos2unix.x86_64
    dos2unix nginx.sh 格式转换
    cat -A nginx.sh |head -6 查看

    2.命令行提示符-bash-4.1$或-bash-4.2$

    方法1 从别人家复制 oldboy (提示权限拒绝)

    -bash-4.2$ whoami 
    alex
    -bash-4.2$ cp /home/oldboy/.bash*  ~
    cp: cannot stat ‘/home/oldboy/.bash*’: Permission denied
    -bash-4.2$ ll -d /home/oldboy/
    drwx------ 2 oldboy oldboy 99 Apr 23 12:01 /home/oldboy/
    -bash-4.2$ ls /home/oldboy/
    ls: cannot open directory /home/oldboy/: Permission denied
    

    方法2 从/etc/skel复制 (√)

    -bash-4.2$ cp /etc/skel/.bash*   ~
    -bash-4.2$ 
    -bash-4.2$ logout
    [root@oldboyedu59 ~]# su - alex 
    Last login: Wed Apr 24 11:44:23 CST 2019 on pts/0
    [alex@oldboyedu59 ~]$ 
    [alex@oldboyedu59 ~]$ 
    [alex@oldboyedu59 ~]$ 
  • 相关阅读:
    Linux 套接字编程
    Linux 网络(连接)相关参数作用
    Python WSGI
    Ubuntu Cloud Image in Openstack
    AWK
    MySQL--开发技巧(一)
    spring MVC--配置注解
    javascript-JQuery样式篇(一)
    JSP--常用标签
    spring MVC basic
  • 原文地址:https://www.cnblogs.com/bidad/p/11924450.html
Copyright © 2011-2022 走看看