alias 與 字串 - Linux

Margaret avatar
By Margaret
at 2011-10-13T11:00

Table of Contents

shell是tcsh
小弟原本要寫一個alias
但一直出錯
簡化到後來 發現
alias test_cmd "echo \" "
這樣是錯的 錯誤訊息如下 會回報沒有能配對的雙引號
Unmatched ".
不過我中間那個雙引號前有反斜線
不知為什麼會這樣?


--
Tags: Linux

All Comments

Delia avatar
By Delia
at 2011-10-14T16:47
你的test_cmd是echo " 就沒match啦
Ingrid avatar
By Ingrid
at 2011-10-15T11:33
應該不是 像alias test_cmd "echo \"\" " 也不match
Frederica avatar
By Frederica
at 2011-10-15T22:48
http://www.grymoire.com/Unix/Csh.html#uh-10 應該沒辦法
只能用單引號了
Aaliyah avatar
By Aaliyah
at 2011-10-17T09:23
或者使用字串串接
Faithe avatar
By Faithe
at 2011-10-22T01:47
居然是斬釘截鐵的impossible... 感謝感謝!
Caroline avatar
By Caroline
at 2011-10-24T21:54
其實是可以的 "echo \"'"'" "這樣...
Belly avatar
By Belly
at 2011-10-28T15:12
看錯了...

在遠端機器執行指令

Dinah avatar
By Dinah
at 2011-10-13T02:25
最近工作上需要查看某台機器(say A)上的連線,是從哪台機器(say B)連過來的 然後去看remote machine上哪一個process連過來的 現在遇到的問題是我的script是在A跑的,所以我勢必要跑個remote command on B, 但是我找到的方法都是用ssh andlt;use ...

在遠端打firefox卻打開本機端的firefox

Ula avatar
By Ula
at 2011-10-13T01:48
第一次碰到這個狀況 百思不得其解...想請問有沒有人知道原因 詳述如下 andlt;電腦A: 遠端SSH伺服器andgt; Ubuntu 10.04 firefox 3.6.17 andlt;電腦B: 遠端SSH伺服器andgt; Ubuntu 8.04 firefox 3.6.17 andlt;電 ...

Debian和OpenSUSE的抉擇問題

Harry avatar
By Harry
at 2011-10-13T00:55
Debian 也有圖形化安裝光碟可以用 http://cdimage.debian.org/debian-cd/current-live/i386/iso-hybrid/ 上面有 GNOME/KDE/LXDE/XFCE 這四種桌面環境的安裝 DVD ISO 任君挑選 http://cdimage.debian ...

如何使用ssh之後再連VNC在只有一個port的時候

Puput avatar
By Puput
at 2011-10-12T16:35
看到網路上有不少解法是先建立ssh tunnel後再使用VNC連入 因為防火牆的關係,我的伺服器只能使用80 port以及22 port 我該如何做才能在不新增port的狀況下使用VNC呢 謝謝andlt;(_ _)andgt; - ...

Debian跟BSD上類似killall5的指令?

Agatha avatar
By Agatha
at 2011-10-12T05:20
我偶爾會在SSH遠端伺服器用到killall5這個指令 (killall5的man page摘要: killall5 is the SystemV killall command. It sends a signal to all processes except kernel threads and th ...