---
title: "shell的学习笔记"
author: "cevin15"
date: "2013-08-17T13:02:05Z"
tags: []
categories: ["操作系统"]
slug: "shell"
draft: false
lastmod: "2013-08-17T13:02:05Z"
id: 1926434
url: "https://cevin15.iteye.com/blog/1926434"
---

最近在找工作，前些天被问起shell的问题。发现这块真是自己的软肋。趁着下午无聊，学习下。顺便做下笔记，已备忘。

1.Hello world。
新建个filename.sh的文件。内容如下。

```java
#!/bin/sh
#print hello world in the console window
a="Hello world!"
echo ${a}
```

保存退出，执行./filename.sh。
这时候我遇到个问题

```java
-bash: ./filename.sh: Permission denied
```

没权限，给个权限再执行。

```java
chmod 777 filename.sh
```

顺利输出Hello world!