English 中文(简体)
草草概念性问题[非公开]
原标题:Bash conceptual questions [closed]
  • 时间:2012-05-22 01:09:20
  •  标签:
  • linux
  • bash

我是新来的Linux & amp; shash, 我正在研究一些不同的脚本, 但我有一些概念性问题需要解答, 以便帮助我找到最好的方法,

  1. 将数据存储在制表单脚本中并将它保存为文件的最有效方式是什么? 另一个脚本可以快速分析?

  2. 彩色大餐菜单的好例子是什么?我怎么能在狂欢中有一个多栏菜单呢?

  3. 我可以在制片中显示图像, 还是最好将图像信息发送到, 比如通知发送, 并且让它显示任何图像?

谢谢

最佳回答

问题多得令人费解:-)

首先,以 bash 脚本存储数据的最有效方式取决于 entirely 的数据和您想要对它进行的处理。如果处理过程由 bash 本身进行,则在 bash 变量中可能更快(大小允许)。如果外部程序,如 grep sed awk 将在 bash 的指导下进行处理,文件可能更好。

但它是一个 very 通用指南 - 您需要分析数据及其使用, 特别是因为 how its s 存储在文件中也很重要。 例如, 如果我单用 bash 处理, 我就不会将固定的长度记录存储为 XML 文件, 因为这意味着我需要为 shell 编写大量的 XML 处理代码。 我大概只是把它作为固定长度记录存储在一个平坦的文件中 。

其次,我没有为您提供实例, 因为 < code> bash 往往要么是命令行驱动的, 要么最多就是非常简单的基于菜单的东西。 它通常不用于精巧的 UI 工作 。

你可以很容易地拥有多栏菜单, 最简单的形式是:

echo "1. Enter new contact.       4. Find contact"
echo "2. Edit contact             5. Exit"
echo "3. Delete contact"

最后, bash 本身对于显示比 ASCII 艺术更复杂的图像没有任何支持:

  |\_/|
 / @ @ 
( > º < )
 \__V__/
 /  O  

所以,如果你需要比这更复杂的东西, 你可能会把它传递给外部程序。

问题回答

暂无回答




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...