You are here

instructor

posts relating to classes I'm teaching

Comparing Strings in the Shell: Pattern Substitution Operator

One problem with using the truncate operator for string matching is case matching.

In the truncate operator example, ${foo%%*ATE} matches SENATE.


DALEK$ foo=SENATE
DALEK$ if [ '' = "${foo%%*ATE}" ] ; then echo "$foo! $foo!"; fi
SENATE! SENATE!
DALEK$

It will not match Senate because ate and ATE are different cases.


DALEK$ foo=Senate
DALEK$ if [ '' = "${foo%%*ATE}" ] ; then echo "$foo! $foo!"; fi
DALEK$

Comparing Strings in the Shell: Truncate Operator

While creating materials for my bash class I needed to create some globbing exercises for my students.

It occurred to me that a string operator and a comparison to the null string can be used to check if something is a substring of another value.

Sure, you can use Substring Expansion to see if the substring is at a known location such as "Does the value of $foo start with 'bar'?", but length and location are often unknown.


$ foo=barfood
$ if [ 'bar' = "${foo:0:3}" ]; then echo $foo; fi
barfood
$

Job Night @ Stammtisch on 2014Jul15

ANNOUNCEMENT: Job Night @ Stammtisch! The Free Software Stammtisch is hosting a job fair at this coming east valley event on Tuesday, 2014Jul15. The goal is to bring in engineers and managers from groups that are hiring as well as job seekers and recruiters. For technical positions it's much better to talk directly to the team that is hiring.

Great tech resume workshop turnout

We filled the room for the Tech Resume Workshop. It was great to see a good turnout of both job seekers and those volunteering to help with resume feedback and practice interviews.

Thanks to the volunteers who showed up to help!

We will likely hold another job event either in November or January. Still debating. The next event will be a job night. The goal is go have sysadmins, developers and hiring managers from companies that are hiring come out looking for people to fit the openings. We had some of that this time around as well :).

Tech Resume Workshop @ the FLOSS Stammtisch

This month's Free Software Stammtisch will feature a no cost tech resume writing workshop.

Despite low unemployment in the tech industry, it is still difficult to get a start in the industry.

On this Tuesday, 2013Sep17, there will be a tech resume workshop starting at 18:00. It will run up to two hours.

The workshop will specialize on resumes for technical fields such as system administration, development, IT/MIS, NOC and network administrator.

Iguana Macks

scalable log storage and analysis at PLUG

This Thursday Kibana creator Rashid Khan will talk scalable log storage and analysis at PLUG. His talk will cover patterns for log shipping, the problems in traditional centralized log storage, as well as issues with syslog shipping overall. We'll explore the options in the open source space, and define a stack that can be gradually merged into a legacy syslog network, with further optimizations as we later spin down the legacy redundant logging infrastructure.

comparing strings in the shell

While creating materials for my bash class I needed to create some globbing exercises for my students.

It occured to me that a string operator and a comparison to the null string can be used to check if something is a substring of another value.

Sure, you can use Substring Expansion to see if the substring is at a known location such as "Does the value of $foo start with 'bar'?", but length and location are often unknown.

Say, for instance, I wanted to know if it's a word a Dalek would shriek? Easy to do with regular expressions: grep ate$ /usr/share/dict/words.

CentOS Dojo this Friday in Scottsdale

CentOS has started a new series of one day conferences. The second CentOS Dojo is taking place in Scottsdale this Friday. Karanbir Singh is in town to lead the conference.

Scheduled talks cover topics such as Logstash ( scalable log management and searching ), Sensu ( scalable monitoring framework ), CentOS Linux kernel tuning, high volume metrics collection, CentOS and Xen virtualization, ARM architecture servers and SSH.

Job Night @ Stammtisch

ANNOUNCEMENT: Job Night @ Stammtisch! The Free Software Stammtisch is hosting a job night at this coming east valley event on Tuesday, 2012Oct16. The goal is to bring in engineers and managers from groups that are hiring in addition to job seekers and recruiters. For technical positions it's much better to talk directly to the team that is hiring.

new modules for shell scripting class

Added several modules to my shell scripting class tonight. Added a couple that had been recently been created. Also added a couple I created tonight. Good work on a couple others as well, but they're not yet going online. Working on a lab exercise now. It should be available for tomorrow.

Pages

Subscribe to RSS - instructor