content top

Using conditional expressions to improve your shell scripts

You can use these very simple shell script conditional expressions to improve your home-made scripts, making them more efficient and easy to mantain. To check if a file exists and it’s executable, use: #!/bin/bash FILE=/usr/bin/passwd if [ -x $FILE ]; then echo "File $FILE exists and it is executable" else echo "File $FILE does not exists or it isnt executable" fi There are several other options. Here’s the...

Read More

Teste: Mod Syntax Highlighting

Encontrei este mod e passarei a usá-lo de agora em diante. Quem quiser ter um igual é só instalar este mod aqui. ?View Code JAVA1 2 3 4 5 public class Hello { public static void main(String[] args) { System.out.println("Olá mundo!"); } } ?View Code BASH1 2 3 4 #!/bin/bash FILE=/etc/file echo $FILE echo "string" ?View Code PHP<?php function foo() { echo...

Read More
content top