Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux shell basic Syntax B

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Let's move on to the basics of shell programming.

This section starts with consolidating the use of redirects, creating your own file descriptors, and focusing on the use of temporary and permanent redirects in writing shell scripts.

(1)

< >

>

In order to distinguish the redirection symbols above, you just need to understand the following two examples:

Cat > file fileA means that both stdout and stderr are redirected

For file descriptors, we not only need to master 0Jet 1 and 2, but also to be able to create our own file descriptors and combine them with the default standard file descriptors in shell programming. For example, restoring a file descriptor is an example.

Exec 3 > & 1

Exec 1 > testfile

...

...

Exec 1 > & 3

...

...

The above is the recovery of output redirection, and the input redirection is as follows

Exec 6

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report