Language Selection

English French German Italian Portuguese Spanish

BASH shell scripting tip: Set default values for variable

Filed under
HowTos

A shell variable may be assigned to by a statement using following syntax:
var=value If value is not given, the variable is assigned the null string. In shell program it is quite useful to provide default value for variables.

For example consider rsync.sh script:

#!/bin/bash
RSRC=$1
LOCAL=$2
rsync -avz -e ’ssh ‘ user@myserver:$RSRC $LOCAL

This script can be run as follows:

More Here.



More in Tux Machines

Leftovers: Gaming

today's howtos

Leftovers: Software

Intel Beignet Is Working Out Surprisingly Well For OpenCL On Linux

Beignet is the project out of Intel's Open-Source Technology Center for exposing GPGPU/compute capabilities out of Ivy Bridge hardware and newer when using a fully open-source Linux stack. While Beignet differs greatly from Gallium3D's Clover state tracker, this Intel-specific open-source OpenCL implementation is working out quite well for Ubuntu Linux. While I've been writing about Intel's Beignet project since early 2013, it's probably been about a year now since I tried out the code, which is developed by Intel's OTC graphics team in China. This weekend I tried out Beignet v0.9.2 as trying out the newest Intel OpenCL code has been on my TODO list for a while and it's been working out rather well in my initial tests. Read more