我怎樣才能將我的cygwin bash轉換爲c Shell。
我試圖通過更改安裝目錄中的.bat
文件,如:
@echo off
@echo ----Welcome NAME----
@echo 'have a nice day'
cygdrive\
chdir \
set HOME=\cygwin\home\
tcsh -i
請大家幫忙。
這是正確的過程嗎?
雖然它對我有點...
任何想法...?將cygwin bash轉換爲tcsh
回答
要更改您的Cygwin shell,您可以更改/etc/passwd
文件。每行都是用戶帳戶的分隔列表,最後一個條目是該用戶的shell。只需更改讀取的行,例如:
abhisek:[some other stuff]:/usr/bin/bash
到:
abhisek:[some other stuff]:/usr/bin/tcsh
另請參閱:維基百科的[passwd](http://en.wikipedia.org/wiki/Passwd_%28file%29)文章和http://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/ – Xophmeister
這是正確的,但是在'cygwin.bat'中使用'bash'硬編碼時,它並沒有幫助他執行shell。他需要執行一些東西,檢查他的默認shell(在'passwd'中)並執行它。那是什麼? –
我不確定這是一個問題,因爲Cygwin現在提供了MinTTY,它可以自動完成所有工作。 (同樣,我使用PuTTY。)我想不出爲什麼有人想在Windows命令提示符下使用* sh。 – Xophmeister
Cygwin的當前版本不具有/etc/passwd文件文件,並在系統我在我的控制之下,在域數據庫中處理Windows帳戶信息。因此,不再支持chsh。
我還發現,慶典是不是硬編碼到startxwin腳本,也不是任何蝙蝠文件有硬編碼。原來你根本不需要撥弄.bat文件。
搜索如何改變我的殼,我發現了一些建議有關mkpasswd
我把它添加到混合物中。
該名男子頁說:
SYNOPSIS mkpasswd [OPTIONS]... OPTIONS Don't use this command to generate a local /etc/passwd file, unless you really need one. See the Cygwin User's Guide for more information. -c,--current Print current user. DESCRIPTION The mkpasswd program can be used to create a /etc/passwd file. Cygwin doesn't need this file, because it reads user information from the Windows account databases, but you can add an /etc/passwd file, for instance if your machine is often dis‐ connected from its domain controller. Note that this information is static, in contrast to the informa‐ tion automatically gathered by Cygwin from the Windows account databases. If you change the user information on your system, you'll need to regenerate the passwd file for it to have the new information. For very simple needs, an entry for the current user can be cre‐ ated by using the option -c.
(我不知道爲什麼間距是如此 「關閉」 ...)
然後我用下面的命令:
mkpasswd -c | sed -e'sX/bashX/tcshX'| tee -a/etc/passwd
和瞧!下一次我打開一個Cygwin終端時,它直接去了tcsh
而這就是方式(呃,呃!)我喜歡它。
- 1. Bash - 將sub.site.com轉換爲com_site_sub?
- 2. 將cshell轉換爲bash
- 3. 將Cygwin PID轉換爲Windows PID
- 4. cygwin bash正斜槓轉換爲反斜槓
- 5. Bash轉換爲pdf
- 6. AppleScript轉換爲Bash
- 7. 是在tcsh中或bash
- 8. Tcsh和Bash初始化
- 9. 將xargs Bash命令轉換爲PowerShell?
- 10. 從cshell執行bash shell(tcsh)
- 11. 用bash將hex轉換爲uint64_t
- 12. 將JSON轉換爲bash環境變量
- 13. 將Bash腳本轉換爲PowerShell
- 14. 將csh腳本轉換爲bash腳本
- 15. 將腳本從ksh轉換爲bash
- 16. Bash:將非ASCII字符轉換爲ASCII
- 17. Bash將日期轉換爲時間戳
- 18. 將路徑轉換爲字符串bash
- 19. 將bash轉換爲批處理文件
- 20. Bash - 將字符串轉換爲日期
- 21. 將Bash腳本轉換爲Shell
- 22. 將Dockerfile轉換爲Bash腳本
- 23. 在bash中將行轉換爲json
- 24. 將多行bash轉換爲單行
- 25. 將舊的csh別名轉換爲bash
- 26. 在bash中將stdout轉換爲utf8
- 27. 將JSON數組轉換爲Bash數組
- 28. Bash - 將MONGODB BSON轉換爲JSON
- 29. 將此請求從Bash轉換爲Python?
- 30. 將mongo bash $或命令轉換爲php
'@echo ...'顯然是DOS批處理文件主題。我在這裏沒有看到什麼是bash。你爲什麼要使用'tcsh'。如果你要寫很多腳本,'bash'顯然是首選。如果您選擇回答這些問題,請編輯您的主要問題,並且不要在此回覆。祝你好運。 – shellter
@shelter - 用戶試圖讓cygwin啓動bat文件啓動一個tcsh shell,而不是默認的bash shell。殼牌的偏好基本上是一個宗教戰爭問題,所以不值得辯論。 –
@shelter:當然,他寫道他正在改變'.bat'(Windows批處理)文件,它執行Cygwin的shell。你應該讀得更好。他顯然不希望將其用於腳本編寫,而是將其用作交互式shell。 –