1.sh+脚本的相对路径

[jinghang@hadoop101 datas]$ sh helloworld.sh

helloworld

sh+脚本的绝对路径

[jinghang@hadoop101 datas]$ sh /home/jinghang/datas/helloworld.sh

helloworld

bash+脚本的相对路径

[jinghang@hadoop101 datas]$ bash helloworld.sh

Helloworld

bash+脚本的绝对路径

[jinghang@hadoop101 datas]$ bash /home/jinghang/datas/helloworld.sh

Helloworld

2.赋予helloworld.sh 脚本的+x权限

[jinghang@hadoop101 datas]$ chmod +x helloworld.sh

执行脚本

相对路径

[jinghang@hadoop101 datas]$ ./helloworld.sh

Helloworld

绝对路径

[jinghang@hadoop101 datas]$ ./home/jinghang/datas/helloworld.sh

Helloworld

shell脚本的常用执行方式的更多相关文章

  1. shell脚本4种执行方式

    Linux中shell脚本的执行通常有4种方式,分别为工作目录执行,绝对路径执行,sh执行,shell环境执行. 首先,看下我们的脚本内容 [tan@tan scripts]$ ll total -r ...

  2. SHELL脚本和常用命令

    什么是脚本? 脚本简单地说就是一条条的文字命令(一些指令的堆积),这些文字命令是可以看到的(如可以用记事本打开查看.编辑). 常见的脚本: JavaScript(JS,前端),VBScript, AS ...

  3. shell脚本中常用命令

    1           Shell中的特殊符号 1.1           $  美元符号.用来表示变量的值.如变量NAME的值为Mike,则使用$NAME就可以得到“Mike”这个值. 1.2    ...

  4. python常用执行方式&变量&input函数

    linux系统中执行py文件方式:  ./a.py 需要执行权限 chmod -R 777(最大权限) 常用执行方式: 1. ./a.py2. python a.py 文件内部头加上 #!/usr/b ...

  5. shell脚本介绍、shell脚本结构和执行、date命令用法、shell脚本中的变量

    7月11日任务 20.1 shell脚本介绍20.2 shell脚本结构和执行20.3 date命令用法20.4 shell脚本中的变量 20.1 shell脚本介绍 1.shell脚本语言是linu ...

  6. Linux centosVMware shell脚本介绍、shell脚本结构和执行、date命令用法、shell脚本中的变量

    一. shell脚本介绍 shell是一种脚本语言 aming_linux blog.lishiming.net 可以使用逻辑判断.循环等语法 可以自定义函数 shell是系统命令的集合 shell脚 ...

  7. 执行shell脚本的四种方式(转)

    原文网址:https://www.jb51.net/article/53924.htm 这篇文章主要介绍了Linux中执行shell脚本的4种方法,即总结在Linux中运行shell脚本的4种方法. ...

  8. 执行shell脚本的四种方式

    这篇文章主要介绍了Linux中执行shell脚本的4种方法,即总结在Linux中运行shell脚本的4种方法. 前提:bash shell 脚本的方法有多种,假设我们编写好的shell脚本的文件名为h ...

  9. Shell 脚本中调用另一个 Shell 脚本的三种方式

    主要以下有几种方式: Command Explanation fork 新开一个子 Shell 执行,子 Shell 可以从父 Shell 继承环境变量,但是子 Shell 中的环境变量不会带回给父 ...

随机推荐

  1. CSS背景处理

    CSS背景处理 背景样式 背景颜色 如果想让一个区域具有纯色的背景,可以使用background-color进行设置,背景颜色可以是rgb,rgba,#16网页色. <!DOCTYPE html ...

  2. Ubuntu14.04 安装VMware tools

    Ubuntu14.04 安装VMware tools 方法一: 1. 在VMware 11(个人的测试环境为vm 11版本)下安装Ubuntu镜像:ubuntu-14.04.1-desktop-amd ...

  3. mybatis的<if>标签,<foreach>标签,<collection>标签,<association>标签以及useGeneratedKeys用法

    <if>标签 1.判断非空或不等于 <if test="assessTypes!= null and assessTypes!='' "> AND FIND ...

  4. 题解 CF1385D 【a-Good String】

    题意 定义:字符串s 为一个c-好串(c 为一个字符)时,必须满足: 当\(|s| = 1\) ,\(s = c\) 当\(|s| > 1\), \(s\) 的左半部分为全为 \(c\),右半部 ...

  5. 牛客练习赛 66B题解

    前言 当初思路 开始没想到异或这么多的性质,于是认为对于每个点\(u\),可以和它连边的点\(v\)的点权 \(a_v=a_u \oplus k\)(证明:\(\because\) \(a_u\opl ...

  6. Python 中的面向对象编程

    面向对象编程(Object-oriented programming, OOP)是一种基于对象概念的编程范式,可包含属性(attribute)形式的数据以及方法(method)形式的代码.另一种对 O ...

  7. postman之测试集

    简单点,说话的方式简单点 步骤1:测试全部通过,哈哈~ 开玩笑! 适用场景:多组数据测试,像排比句那样,有规律,比如姓名,性别,年龄.这时候的测试要求就是这些信息与返回体的结果做比较!! 步骤1:创建 ...

  8. Java基础之java8新特性(1)Lambda

    一.接口的默认方法.static方法.default方法. 1.接口的默认方法 在Java8之前,Java中接口里面的默认方法都是public abstract 修饰的抽象方法,抽象方法并没有方法实体 ...

  9. Spring葵花宝典

    一 Spring简介 Spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架 为了解决企业应用开发的复杂性而创建 二 Spring功能 1. 方便解耦 简化开发 Spring就是一 ...

  10. pillow 压缩和放大图片

    记住这个  resize()方法 from PIL import Image img=Image.open("test.png") x,y=img.size print(x,y) ...