Bash - Read input from file

#!/bin/bash
cat myfilename.txt |     # Supply input from a file.

Bash - Loops

For loop

#!/bin/bash
# Display each filename returned by ls.

Bash - Conditional Statements

NOTE: Spacing is very important on the IF statement line.

Bash - Get date and time

date_time=`date +%Y-%m-%d_%H.%M.

DOS - ECHO %DATE% %TIME% doesn't work in FOR loop

ECHO %DATE% %TIME% doesn't work in FOR loop. Here is an example:

Debian - Packages

All packages used.

Debian - VNC Server

  1. Install VNC Server.
      aptitude -y install vnc4server
     
  2. You must run VNC Server at least once to setup the password.
      vncserver
     

Debian - Files / Directories listings

List files by sizes

Bash

Variables

  • No spaces between the variable name and the value to be assigned
DATE_STRING=$(date +"%Y-%m-%d.%0k.%M.%S")

TestNG - Ant build using TestNG-XSLT

Ant build using TestNG-XSLT

<!-- 
  Example for TestNG-XSLT
    Run this target only after TestNG had generated the xml resutl file(i.e. testng_output/testng-results.xml).
    Change TestNG-XSLT stylesheet path accordingly(i.e. lib/testng-xslt-0.6.2/src/main/resources/testng-results.xsl).
-->
<target name="testng_nice_report">
  <mkdir dir="testng_nice_report"/>
  <xslt in="testng_output/testng-results.xml" 
        style="lib/testng-xslt-0.6.2/src/main/resources/testng-results.xsl"
        out="testng_nice_report/index.html">

Pages

Subscribe to OpenWritings.net RSS