tailieunhanh - wiley publishing suse linux 9 bible phần 6

Tham khảo tài liệu 'wiley publishing suse linux 9 bible phần 6', ngoại ngữ, ngữ pháp tiếng anh phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 10 Text Manipulation 243 user@bible cat file3 X Y Z paste file1 file2 file3 1 A X 2 B Y 3 C Z In this first example you have put together corresponding lines from the three files in the order given with white space between. paste -d filel file2 file3 1 A X 2 B Y 3 C Z In this next example by specifying -d you have forced the delimiter in the output to be the colon rather than the default spaces. join The join command takes two files with lines split into fields and where a particular field is identical it takes the other fields from both files and combines them. What follows is a simple example. There are of course options to control which field is regarded as the key. user@bible cat file1 001 beef 002 beer 003 pies user@bible cat file2 001 water 002 wine 003 apples user@bible join file1 001 beef water 002 beer wine 003 pies apples file2 awk awk is something rather bigger than the tools we have been discussing up to now it is an entire language. awk is an interpreted scripting language in other words programs written in awk do not need to be compiled before they are run. We shall present a few simple uses of awk just as a command line here. You will see it used also usually as a simple single line command quite often in system shell scripts and it is certainly useful to know about its existence. But if you want to do the kinds of things that awk does well selecting and replacing text in text files according to rules that you program you should consider whether the task could be done more simply and easily by another and more powerful scripting language 244 Part III Using the Command Line in SUSE Linux such as Python or Perl . On the other hand awk is a much smaller program and is always available user@bible cat foods boiled carrots fried potatoes grilled onions grated carrot user@bible awk carrot foods boiled carrots grated carrot Here awk has simply selected the lines that match carrot user@bible awk print 1 foods boiled fried grilled grated In this .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.