⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 03 - testing whether a program is running interactively.rb

📁 O Reilly Ruby Cookbook source code
💻 RB
字号:
#!/usr/bin/ruby -w# interactive_or_not.rbif STDIN.tty?  puts "Let me be the first to welcome my human overlords."else  puts "How goes the revolution, brother software?"end#---$ ./interactive_or_not.rbLet me be the first to welcome my human overlords.$ echo "Some data" | interactive_or_not.rbHow goes the revolution, brother software?$ ./interactive_or_not.rb < input_fileHow goes the revolution, brother software?#---

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -