Jump to...
redirecting...

Log for Ubuntu 台灣社群

1.
env GOTRACEBACK=all go run .

2.
GOTRACEBACK=all go run .

查網路看到第一種用法
但第二種用法也可以執行
請問 差異在哪邊啊?
我習慣用第二個
一個是外部命令一個不是:
$ type env
env 是 /usr/bin/env
第二個用法適用於 shell 內建命令:
brlin$ help for
for: for 名稱 [in 字詞 … ] ; do 命令 ; done
    為列表中的每個成員執行命令。
    
   「for」迴圈為列表中的每個成員執行一系列的命令。如果沒有
   「in WORDS ...;」則假定使用「in "$@"」。對於 WORDS 中的每
    個元素,NAME 被設定為該元素,並且執行 COMMANDS 命令。
    
    退出狀態:
    回傳最後執行命令的狀態。

brlin$ LANG=C help for
for: for NAME [in WORDS ... ] ; do COMMANDS; done
    Execute commands for each member in a list.
    
    The `for' loop executes a sequence of commands for each member in a
    list of items.  If `in WORDS ...;' is not present, then `in "$@"' is
    assumed.  For each element in WORDS, NAME is set to that element, and
    the COMMANDS are executed.
    
    Exit Status:
    Returns the status of the last command executed.

brlin$ env LANG=C help for
env: ‘help’: 沒有此一檔案或目錄
問個,用在 production 的話推哪個 LTS 發行版?
第二個用法適用於 shell 內建命令:
抱歉 看不懂 什麼叫 內建的命令

第一個 我知道是外部指令
有一些命令是 shell (sh/bash) 內建的(builtin commands),而非外部程式提供
cdhelp 命令

細節請參閱 GNU Bash 使用手冊 > Shell Builtin Commands
兩個都推,看需求
需求是架 LINE Bot 用 C/C++, Java
所以要跑 nginx 跟 JVM 這樣
如果需要用到比較新的程式庫用 Ubuntu 比較方便
當然是ubuntu
然後 Ubuntu 原生支援 Snap 軟體
那看起來兩者都適合
難道你想叛教?
Snap 是行動裝置那個?
入了本教,別想跑了
行動裝置、 IoT 跟一般電腦都有
謝謝 明白了
剛剛嘗試一下
cd 原來是 外部命令
ls 是 bash 內部命令
我從一開始就是 Debian 使用者,所以反而還好XDD
有這種差異~~
原來,所以算是跨平臺的 App Store 的感覺
有部份命令是兩者皆是,如 `printf`:

$ type -a printf
printf 是 shell 內建
printf 是 /usr/bin/printf
原來可以用 type -a 來看(筆記
似乎 沒必要 特別使用 env
第二種作法一定可以執行
也沒副作用?

效果是一樣的,但是第二個作法省掉了外部呼叫的成本
參閱 GNU Bash 使用手冊 > Basic Shell Features > Executing Commands > Environment 章節的說明:

The environment for any simple command or function may be augmented temporarily by prefixing it with parameter assignments, as described in Shell Parameters. These assignment statements affect only the environment seen by that command.

https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameters
RHEL,有付錢的那種
所有問題都往RH丟
Ubuntu Advantage,有付錢的那種(ry
LANGTEST=C help for

這樣是表示 建立一個 LANGTEST 的環境變數
傳給 help ?

不太確定 LANGTEST 是 自訂變數 還是 環境變數
是環境變數
學校沒經費給我用,哭哭
自訂變數沒有用 export 命令匯出之前不會修改子進程的環境
那就隨便阿
非常謝謝
之前只知道 先 export 在 呼叫命令

剛剛第一次看到 直接設定一個 環境變數 呼叫命令
原來可以這樣 直接 傳遞 不用 汙染 現在的 bash
拿archlinux都可以很production
<del>邪道</del>
邪道 +1
我們還是遵從ubuntu正教吧
👇👉👌🥰

v.ht/Anna89
原來 export 的真正用途是這個... 學到了
我之前就有一台用archlinux當server
後來得重新開機的次數太頻繁 我就換成別的了
可以不要滾kernel
> 我們還是遵從ubuntu正教吧
Debian 表示:
學到了@@ IgnorePkg=linux
People who give up are the people who lose in life, my first experience happens to be a failure but i never gave up cause i knew it was going to work out for me trying continuously, fortunately I'm smiling today by getting involved on the platform of a legitimate manager Vickie Cohen , i just have to say that Binary option has done me so much good favour ever since i knew manager Vickie Cohen,until we realize that everything is trial we cannot be victorious in life, the challenge i took is the reason for my success today i just hope that other investors will do same by locating Manager Vickie Cohen platform in order to be happy again, connect her now
👇👇👇
@Vickiecohen