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 3 weeks 2 days ago – Made popular 3 weeks 2 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 3 weeks 2 days ago – Made popular 3 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 Timothy van Zad... 3 weeks 2 days ago – Made popular 3 weeks 2 days ago
Category: Tech   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 3 weeks 2 days ago – Made popular 3 weeks 2 days ago
Category: Tech   Tags:
1

Linksys Linux-based media server Wireless-N router

http://www.linksysbycisco.com

Irvine, CA – June 23, 2009 – Cisco® today announced a new Linux powered router, the Linksys by Cisco Wireless-N Broadband Router with Storage Link (WRT160NL). The new model complements the existing Linksys by Cisco consumer router line-up and is essentially the next generation of the popular WRT54GL. The design of the product is similar to other Linksys by Cisco N-routers, but has integrated connectors for external antennae. Consumers that prefer external aerials can now enjoy the new Linksys by Cisco router design because of the integrated R-SMA antenna connectors.


Read more »
Created by kaikokan 37 weeks 20 hours ago – Made popular 37 weeks 20 hours ago
Category: Tech   Tags:
1

ZMP's RoboCar is Linux-based, cute as hell

http://www.engadget.com

Hot deals on Notebooks from Dell, Toshiba, Gateway and more. Lots of great notebook accessories too!

Pictures and video of the ZMP Linux based Robocar. I think I don't know anybody who wouldn't want one.
I'm just curious if they can make it transport my groceries from the supermarket.


Read more »
Created by j00p34 37 weeks 5 days ago – Made popular 37 weeks 5 days ago
Category: Tech   Tags:
1

3d touch screen tracks distance and speed above screen

http://www.physorg.com

Will this be the future of handheld technology? A touch screen tracking your moves without touching it, combine this with 3D technology and you have the future in your hands. It can detect the proximity of a finger at 20mm and it senses distance. A little off topic, but we see a linux device using this soon hopefully :-)


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

Add this site to google
Add to Google

site feed

Syndicate content

don't forget to vote if you find something useful!!