Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: if

14 Dec

Run a Command if Another Command Succeeds

This will let you run a linux command based on the success of anther command. Note: This will only work in bash shell.


ruby Create_PDF.rb && if [ $? == 0 ]; then kpdf report.pdf; fi 
admin Posted in Command Line, Linux bash, cli, command, conditional, if, Linux, Ruby, shell Leave a comment

Post navigation

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑