61 lines
3.3 KiB
Markdown
61 lines
3.3 KiB
Markdown
|

|
||
|
|
||
|
[](https://www.youtube.com/c/PGTechs "ช่อง YouTube ของเรา")
|
||
|
[](https://www.facebook.com/PrincegameRVCPlus "เพจข่าวสาร Distributed Computing ของเรา บน Facebook")
|
||
|
|
||
|
อีกหนึ่งแอปพลิเคชันคุณภาพจาก SashaPGT
|
||
|
|
||
|
* ทุกแอปพลิเคชันผ่านการทดสอบติดตั้งและใช้งานใน Test environment ของเรา
|
||
|
|
||
|
* ใช้งานได้อย่างสะดวกรวดเร็ว ด้วยสคริปต์ติดตั้งแบบสำเร็จรูป ทั้งเฉพาะผู้ใช้และ System-wide
|
||
|
|
||
|
* รองรับ Linux และ macOS
|
||
|
|
||
|
# sashapgt/pipetofile
|
||
|
|
||
|
[](https://app.travis-ci.com/gitlab/sashapgt/pipetofile)
|
||
|
|
||
|
"จงเขียนโปรแกรมเพื่อรับข้อมูลเป็น string ไปเรื่อยๆ จนกว่าจะพิมพ์เครื่องหมาย . หลังจากนั้นให้จัดเก็บข้อมูลลงในไฟล์ชื่อ /tmp/data.txt ดังตัวอย่าง"
|
||
|
|
||
|
**ตัวอย่างการทำงานของโปรแกรม**
|
||
|
|
||
|

|
||
|
|
||
|
# วิธีการติดตั้ง/ใช้งาน
|
||
|
### ติดตั้งแบบปกติ
|
||
|
1. โคลน git นี้
|
||
|
|
||
|
`$ git clone https://gitlab.com/sashapgt/pipetofile.git`
|
||
|
|
||
|
2. cd เข้าโฟลเดอร์ของ git นี้ แล้วรันสคริปต์ติดตั้ง
|
||
|
|
||
|
`$ cd pipetofile && bash install.sh`
|
||
|
|
||
|
3. เรียกใช้จากเทอร์มินัล (Shell autocomplete อาจจะยังไม่ทำงาน กรุณาปิดเทอร์มินัล แล้วเปิดใหม่อีกครั้ง)
|
||
|
|
||
|
`$ pipetofile`
|
||
|
### ใช้งานครั้งเดียว (Build, run และ remove ทันทีเมื่อใช้งานเสร็จโดยอัตโนมัติ)
|
||
|
$ bash single-use-build-and-run.sh
|
||
|
|
||
|
# ถอนการติดตั้ง
|
||
|
|
||
|
|
||
|
1. รันสคริปต์ถอนการติดตั้งจากในโฟลเดอร์ git นี้
|
||
|
|
||
|
`$ bash uninstall.sh`
|
||
|
|
||
|
2. ลบโฟลเดอร์ git นี้
|
||
|
|
||
|
# การแก้ปัญหา
|
||
|
|
||
|
หากไม่สามารถรันได้เนื่องจาก Command not found ให้ดูว่ามี ~/.local/bin ใน $PATH หรือไม่
|
||
|
สามารถตรวจสอบได้โดยการ
|
||
|
|
||
|
echo $PATH
|
||
|
|
||
|
หากไม่มี Home folder ของคุณ ตามด้วย .local/bin ให้เพิ่มบรรทัดนี้ลงใน Shell startup script ของคุณ (เช่น .bashrc .zshrc)
|
||
|
|
||
|
export PATH="$PATH:$HOME/.local/bin"
|
||
|
|
||
|
|