鍍金池/ 問(wèn)答/Linux/ linux shell problem

linux shell problem

I counld not run script properly.

If I run

#!/bin/sh
echo "Hello.World"

It's good.

But

#!/bin/sh
sudo su
apt-get update
apt-get upgrade

圖片描述
It failed.

What do I need extra ?

Thank you.


update:
圖片描述

回答
編輯回答
終相守

由于不熟悉linux,
都是在windows下編輯文件在ssh 傳過(guò)去

這里我用的編輯器 回車(chē)鍵 不是單純的"0A"而是"0A0D"混入了"0D"導(dǎo)致linux 腳本識(shí)別錯(cuò)誤。

2017年5月17日 08:01
編輯回答
不討囍
#! /bin/sh
sudo apt-get update -y
sudo apt-get upgrade -y
2018年1月29日 08:27