Ssh
putty 中遠端 cmds 的輸出總是在 80 個字元後被截斷
我一直試圖以正確的格式獲得輸出,但毫無結果。我正在執行 putty ssh 命令,命令的輸出被保存到一個文件並傳輸過來。
忽略它是哪個命令的事實,因為當我在膩子會話中手動在伺服器中執行相同的命令時,輸出或將輸出重定向到文件會將其置於正確的格式。
命令:
output=$(drush @website.dev --uri=xyz1.com fl) echo "$output" > xyz1.txt output=$(drush @website.dev --uri=xyz2.com fl) echo "$output" > xyz2.txt output=$(drush @website.dev --uri=xyz3.com fl) echo "$output" > xyz3.txt output=$(drush @website.dev --uri=xyz4.com fl) echo "$output" > xyz4.txt output=$(drush @website.dev --uri=xyz5.com fl) echo "$output" > xyz5.txt
如果我執行命令行,我得到的格式:
National Blog national_blog Enabled 7.x-3.32 N e e d s r e v i e w OpenLayers Test Example openlayers_test_example_fea Disabled 7.x-2.0- Feature ture beta9 Owl Carousel Settings owl_carousel_feature Enabled 7.x-1.0 Password Policy Feature password_policy_feature Disabled Promo Block promo_block Disabled 7.x-1.01 Promo Block i18n promo_block_i18n Enabled 7.x-1.02 RH Accolade rh_accolade Disabled 7.x-1.10 RH Accolade Feature rh_accolade_feature Disabled 7.x-1.0 RH Accolade Translatable rh_accolade_translatable Enabled 7.x-1.04 RH Accolades i18n View rh_accolades_i18n_view Enabled 7.x-0.02 RH Accolades View rh_accolades_view Disabled 7.x-1.0 RH Banner View rh_banner_view Enabled 7.x-0.21 Article Content Type rh_basic_page_feature Disabled 7.x-2.07 RH Blog rh_blog Enabled 7.x-2.20 O v e r r i d d e n
我想獲得的格式以及我在 putty 會話視窗中手動執行此命令時獲得的內容:
RH Job Search rh_job_search_feature Enabled Overridden RH Media Feature rh_media_feature Enabled 7.x-1.13 Overridden Media Page rh_media_page_feature Disabled RH Metro Image Styles rh_metro_image_styles Enabled 7.x-1.00 RH Notifications Feature rh_notifications_feature Disabled 7.x-1.00 Office Location Content Type rh_office_location_feature Enabled Office Locator rh_office_locator_feature Enabled 7.x-1.5 Office Locator v2 rh_office_locator_v2_feature Disabled 7.x-1.0 RH Press Release i18n Content Type rh_press_release_i18n_content_type Enabled 7.x-1.00 RH Promo CT rh_promo_content_type Enabled 7.x-1.21 RH Promo Feature rh_promo_feature Enabled 7.x-1.10 RH Promo i18n Feature rh_promo_i18n_feature Disabled 7.x-1.01 RH Promo Translatable CT rh_promo_translatable Disabled 7.x-1.05 RH Promo Views rh_promo_views Enabled 7.x-1.01 RH Promo Views i18n rh_promo_views_i18n Disabled 7.x-1.00 RH Quicktabs Feature rh_quicktabs_feature Enabled 7.x-0.03 Overridden
PS:我什至嘗試載入一個膩子會話,因此打開的膩子視窗大小不會限制和切斷文本:
putty.exe -load "server session xyz" -m "D:\Projects\Drupal\scripts\daily_feature_lists\commands.txt"
還嘗試更改幾乎所有膩子屬性,包括關閉自動包裝,似乎對我發送的實際遠端命令沒有任何影響,只有在它打開的終端視窗中才會應用膩子配置。
您是否嘗試
COLUMNS
在執行 drush 之前顯式設置變數?例如:
output=$(COLUMNS=120 drush @website.dev --uri=xyz1.com fl) echo "$output" > xyz1.txt