31

Reading a file, line by line

http://bashcurescancer.com

nixcraft has a link on how to read a file line by line. The method is a great way to read a file, but there some trouble spots I thought I would point out.

In the script, the special variable IFS is set:

# set the Internal Field Separator to a pipe symbol
IFS='|'

The tells the read command to split “cyberciti.biz|74.86.48.99″ into “cyberciti.biz” and “74.86.48.99″ and thus fill both the domain and ip variables here:


Read more »
Created by shankar 28 weeks 3 days ago – Made popular 28 weeks 3 days ago
Category: Tech   Tags:
28

Splitting Strings Natively with the Shell: Why

http://bashcurescancer.com

Today I want to discuss splitting strings into tokens or “words”. I previously discussed how to do this with the IFS variable and promised a more in depth discussion. Today, I will make the case on WHY to use IFS to split strings as opposed to using a subshell combined with awk or cut.


Read more »
Created by admin 28 weeks 3 days ago – Made popular 28 weeks 3 days ago
Category: Tech   Tags:
8

HTC Legend: Eye Catching Design With Perfect Features

http://www.buymobilephonesuk.org.uk

HTC Legend is the brand new style statement from the house of HTC. It functioning is based on Android 2.1 operating system, supported by recently out HTC desire as a smaller alternative.


Read more »
Created by rick2k11 11 weeks 4 days ago – Made popular 11 weeks 4 days ago
Category:   Tags:
4

Linux,Windows and Mac users needed for the World Community Grid

http://linusearch.com

By utilizing the power of the World Community Grid Cancer research can be dramatically accelerated.When your computer is idle or between key strokes of light computer use the grid can utilize your unused system resources.


Read more »
Created by gnuisnotunix 11 weeks 3 days ago – Made popular 11 weeks 3 days ago
Category:   Tags:
4

Does free software create a challenge for Linux?

http://linusearch.com

Could it be that one of things that drives many people toward Linux, the fact that it is free as in free beer, is also an impediment to it’s adoption?


Read more »
Created by gnuisnotunix 17 weeks 4 days ago – Made popular 17 weeks 4 days ago
Category:   Tags:
4

DisklessWorkstations.com offers bundled Linux support

http://linusearch.com

DisklessWorkstations.com is providing bundled support for Ubuntu Linux with some of their thin client packages.


Read more »
Created by gnuisnotunix 18 weeks 3 days ago – Made popular 18 weeks 2 days ago
Category:   Tags:
4

Shelling scripting is a necessary skill

http://bashcurescancer.com

Yesterday a 20 line shell script caught a race condition in one of software I work on. Our best engineers looked at the problem, a vendor case was filed, and there was thoughts of automatically restarted the application to fix the issue at hand.

In the end, a 20 line shell script to strace for file operations continuously provided the needed visibility into the issue at hand.

Update: The shell script.

The shell script itself, though trivial, is owned by the company I work for, but the basic concept was as follows:

#!/bin/bash


Read more »
Created by greenx 23 weeks 2 days ago – Made popular 23 weeks 2 days ago
Category: Tech   Tags:
4

Splitting Strings Natively with the Shell: Native vs Native

http://bashcurescancer.com

Splitting Strings Natively with the Shell: Native vs Native

In my previous post on why to split strings with bash itself, I used set to split the string.


Read more »
Created by mr-Z 28 weeks 3 days ago – Made popular 28 weeks 3 days ago
Category: Tech   Tags:
3

Ubuntu 10.04 Review

http://linusearch.com

I am using Ubuntu 10.04 and really enjoying it since I have more programs to choose from then I have had with other versions of Linux.
If you have not tried Ubuntu in a while then you may find it worth while to take another look at this O.S.


Read more »
Created by gnuisnotunix 10 weeks 23 hours ago – Made popular 10 weeks 13 hours ago
Category:   Tags:
2

Temporarily Clearing Environment Variables

http://bashcurescancer.com

After a long break I have some more ideas…. Will be posting them soon. For now, I leave you with a command to clear your current environment:

root@67 [~]# printenv | wc -l
26
root@67 [~]# env -i printenv | wc -l
0

This is very useful when you want to run a command ignoring any environment variables you have set. I use this command with curl nearly everyday to ignore the http_proxy environment variable I have set. Another, longer, option is:

root@67 [~]# http_proxy="" curl ....

I prefer env -i as its simpler.


Read more »
Created by uioloio 28 weeks 3 days ago – Made popular 28 weeks 3 days ago
Category: Tech   Tags:
1

HP Slate Leaked Specification

http://www.techarena.in

It was also confirmed that the HP Slate will run on Atom CPU with Windows 7 support. Other thatn this it will support Flash and USB Connectivity. You will also have a memory card reader intergrated in HP Slate.


Read more »
Created by joeyjuviyani 21 weeks 3 days ago – Made popular 21 weeks 3 days ago
Category:   Tags: