tag:blogger.com,1999:blog-3615332969083650973.post6073041791146940630..comments2024-03-23T07:59:04.047-04:00Comments on sysadvent: Day 1 - Don't bash your process outputsJordan Sisselhttp://www.blogger.com/profile/13694925032675599790noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-3615332969083650973.post-12126500249988770572011-12-03T12:28:30.125-05:002011-12-03T12:28:30.125-05:00I love all the things I've learned from commen...I love all the things I've learned from comments. If I rewrote this article I'd probably use Capture::Tiny and IPC::Run instead.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-55629914426647665472011-12-03T01:26:11.299-05:002011-12-03T01:26:11.299-05:00Thanks for the excellent post. I can't wait to...Thanks for the excellent post. I can't wait to try it. I always feel a little dirty when I bust out the ``. I want my perl to be as perl as possible.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-69598736324824222952011-12-02T21:49:26.010-05:002011-12-02T21:49:26.010-05:00Python-- and
Ruby-- too
for Sysadmin language.
I c...Python-- and<br />Ruby-- too<br />for Sysadmin language.<br />I can't understand who use python or ruby(puppet, chef...crap) for robust system admin tasks.<br /><br />They break language and modules backwards compatibility very easily even in minor version upgrade.<br />It's harder to maintain working language version across servers than do real sysadmin tasks.<br /><br />Use them If you want to see that something is not working today while it is still working well from yesterday.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-63776330533766257302011-12-02T14:57:39.539-05:002011-12-02T14:57:39.539-05:00Why not IPC::Run?Why not <a href="http://p3rl.org/IPC::Run" rel="nofollow">IPC::Run</a>?Jakub Narebskihttps://www.blogger.com/profile/11847202568800326989noreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-72439163511489677722011-12-02T05:43:37.033-05:002011-12-02T05:43:37.033-05:00In reply to what the "That's why people u...In reply to what the "That's why people use bash" anonymous said, one should note that bash also isn't self-contained and often one needs to resort to using external programs which need to be installed separately. So you need to have a way to install them on all servers as well, and should better plan for it.<br /><br />Also see mst’s <a href="http://shadow.cat/blog/matt-s-trout/but-i-cant-use-cpan/" rel="nofollow">“But I can't use CPAN”</a>.Shlomi Fishhttps://www.blogger.com/profile/03931260511676488069noreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-59502163669156327692011-12-01T21:22:43.610-05:002011-12-01T21:22:43.610-05:00People saying python is so awesome: write a rebutt...People saying python is so awesome: write a rebuttal post with code samples or quit your jibberjabber. ;)<br /><br />Dileep: your solution is legit, but note you can't separate stderr and stout that way. IPC::Open3 works for that, tho.<br /><br />Anonymous: Installing perl modules is pretty easy if you're doing proper config management. Also my other point is still valid: processing text in bash sucks. IO::CaptureOutput is a great way to get that data in to perl, then you've got an amazing processing environment.<br /><br />Thank you all so much for reading and commenting!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-33410959729751926862011-12-01T16:22:58.717-05:002011-12-01T16:22:58.717-05:00python +1, its easy to learn and very rich... I...python +1, its easy to learn and very rich... I'm waiting for the day it comes installed by default in all UnixesAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-23605696695100293522011-12-01T13:55:15.246-05:002011-12-01T13:55:15.246-05:00One can also get the output of a command and also ...One can also get the output of a command and also exit code, without using any of CPAN modules. We can achieve the same effect with standard "open" function but using pipes.<br /><br />my $cmd = 'ls -l';<br />open( CMD, "$cmd |" ) or die "$!\n";<br /><br />my $return_code = $? >> 8; # return code of $cmd<br /><br />my $cmd_result = ;<br />close CMD;Dileepnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-65350802771825847842011-12-01T13:33:16.642-05:002011-12-01T13:33:16.642-05:00Python is better for this sort of thing. I would ...Python is better for this sort of thing. I would never encourage anyone to learn perl as a new language.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-43363075610106584222011-12-01T11:42:35.770-05:002011-12-01T11:42:35.770-05:00I think this is exactly the reason people use bash...I think this is exactly the reason people use bash. If I wanted to run that script on 100 different servers i have to install those modules first. However, if I wrote the script in bash, then i don't need to do anything to the servers. I don't think you've made a strong enough argument to convince people to use perl.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-10673765364293989422011-12-01T10:46:38.712-05:002011-12-01T10:46:38.712-05:00Perl can't do this without one of these CPAN m...Perl can't do this without one of these CPAN modules fetched?JBhttps://www.blogger.com/profile/10287396703706750215noreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-61940040466325886012011-12-01T09:10:41.764-05:002011-12-01T09:10:41.764-05:00Cool stuff. Are there ways of dealing with data th...Cool stuff. Are there ways of dealing with data that is being piped into your perl process and potentially used upstream? Is bash better at living in the middle of a list of commands?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3615332969083650973.post-55605656939317439652011-12-01T09:03:26.889-05:002011-12-01T09:03:26.889-05:00Capture::Tiny is also worth looking at, especially...Capture::Tiny is also worth looking at, especially if you have to work on (shudder) Windows.Anonymousnoreply@blogger.com