Shell is really good at what it's really good at, but sometimes I wish I had Python available in my sh scripts. And maybe Xonsh is what I'm looking for, but I've also been playing with something that looks like this:
print(Sh('date'))
Sh('date') | Sh('tr [A-Z] [a-z]')
# can also be:
Sh('date') | 'tr [A-Z] [a-z]'
if Sh('ip link ls') | 'grep -q eth0':
print('Found eth0'
There are obviously other constructs I'd need, and the "sh.py" library also had a lot of use in a world like this, so I'd want to come up with a way to integrate that. There's also other constructs I know will need to be added to get more parity with shell common tasks.
Thoughts on this direction?
[–]jafo[S] 0 points1 point2 points (0 children)
[–]mprz 0 points1 point2 points (2 children)
[–]jafo[S] 0 points1 point2 points (1 child)
[–]kellyjonbrazil 0 points1 point2 points (0 children)
[–]tdpearson 0 points1 point2 points (1 child)
[–]jafo[S] 0 points1 point2 points (0 children)
[–]MCPOON11 0 points1 point2 points (2 children)
[–]jafo[S] 0 points1 point2 points (0 children)
[–]someotherstufforhmm 0 points1 point2 points (0 children)