当前位置:网站首页>How to pipe several commands in Go?
How to pipe several commands in Go?
2022-07-04 03:05:00 【ENIEM】
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("bash", "-c", "squeue | awk '{print $NF}'")
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
err := cmd.Run()
if err != nil {
fmt.Println(cmd.Stdout, err)
}
}
边栏推荐
- The difference between MCU serial communication and parallel communication and the understanding of UART
- In my spare time, I like to write some technical blogs and read some useless books. If you want to read more of my original articles, you can follow my personal wechat official account up technology c
- (column 23) typical C language problem: find the minimum common multiple and maximum common divisor of two numbers. (two solutions)
- Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
- What is the difference between enterprise wechat applet and wechat applet
- No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
- FRP intranet penetration
- Sword finger offer 14- I. cut rope
- Backpropagation formula derivation [Li Hongyi deep learning version]
- Pagoda SSL can't be accessed? 443 port occupied? resolvent
猜你喜欢
How to use websocket to realize simple chat function in C #
Node write API
(column 23) typical C language problem: find the minimum common multiple and maximum common divisor of two numbers. (two solutions)
[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)
Network communication basic kit -- IPv4 socket structure
[Valentine's Day confession code] - Valentine's Day is approaching, and more than 10 romantic love effects are given to the one you love
7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages
What is the difference between enterprise wechat applet and wechat applet
Database concept and installation
Crawler practice website image batch download
随机推荐
Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)
Create real-time video chat in unity3d
Package and download 10 sets of Apple CMS templates / download the source code of Apple CMS video and film website
Contest3145 - the 37th game of 2021 freshman individual training match_ D: Ranking
Contest3145 - the 37th game of 2021 freshman individual training match_ E: Eat watermelon
3D game modeling is in full swing. Are you still confused about the future?
Global and Chinese market for travel wheelchairs 2022-2028: Research Report on technology, participants, trends, market size and share
I stepped on a foundation pit today
[untitled] the relationship between the metauniverse and digital collections
The difference between int (1) and int (10)
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
MySQL query
MySQL workbench use
JS object definition
Database concept and installation
2022 Guangxi provincial safety officer a certificate examination materials and Guangxi provincial safety officer a certificate simulation test questions
System integration meets the three business needs of enterprises
Is online futures account opening safe and reliable? Which domestic futures company is better?
[development team follows] API specification
Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball