How to use awk to select data from commands and scripts

The awk command is incredibly useful, and you will be surprised at just how powerful and transformative it will make your scripts. Here’s how to get started using it.

Image: iStock/Inimma-IS

Must-read developer content

While I’m not a fan of programming, I do love working from the command line as much as possible and have great respect for programmers and what they can do. As I work on evolving my Linux skills, I find a lot of cross-pollination between Linux and macOS in the Terminal due to their shared UNIX-base, and I recently got into using some more advanced (for me) Linux commands on my scripts.

SEE: Top 5 programming languages for systems admins to learn (free PDF) (TechRepublic)

One command that simply blew my mind is awk. For those who are unsure, let me tell you that awk is awesome! Basically, it is like a filter command that interprets data fed to it. Awk scans the file/data and splits the parts of a line into fields. This allows the user to transform the data as they see fit, output reports formatted a certain way, scan for patterns, or perform programming operations based on said data. It also works extremely

Read More View More How to use awk to select data from commands and scripts

2021 Aston Martin DBX review: Hardly heresy

This is Aston’s next big thing.


Jessica Lynn Walker/Aston Martin

Look, the DBX needed to happen. I love Aston Martin’s sports cars as much as the rest of you, but if the company wants to remain relevant — and, more importantly, solvent — over the long term, adding an SUV to the lineup is the right move. It’s not just a trend, it’s a business necessity. See also: the Porsche Cayenne, Lamborghini Urus, et al.

Like

  • Excellent twin-turbo V8
  • Sharp handling
  • Comfortable ride quality
  • Plush interior

Don’t Like

  • Infotainment tech is super old
  • Transmission could be smoother

If history has taught us anything, it’s that SUVs born from sports car manufacturers are still freakin’ good. So why would the DBX be any different? The twin-turbocharged 4.0-liter V8 is sourced from Mercedes-AMG and makes 542 horsepower and 516 pound-feet of torque, so there’s always power available whenever you need it. The V8 sounds awesome — especially through the optional ($2,300) sport exhaust — and this engine provides enough motivation to shoot the big DBX to 60 mph in 4.3 seconds.

I mean it when I say big, too. This SUV is almost deceptively large. In photos, and even in

Read More View More 2021 Aston Martin DBX review: Hardly heresy

When will your new stimulus check come in the mail? Track it with this free USPS tool

Stimulus check or junk mail? Know what to look for so you don’t toss it in the trash.


Angela Lang/CNET

The stimulus check wheels are once again in motion. The IRS is sending second stimulus checks in the mail and turned on its online stimulus check tracker tool, which will ballpark your payment schedule, let you know your second stimulus check total and tell you if there’s been a holdup or other error processing your check

But if you’re eligible for a second stimulus payment, didn’t already set up direct deposit with the IRS, and are therefor due for a physical check or an EIP card instead, there’s only one tool that can tell you when your payment has been scanned at the post office, or has already been delivered to your mailbox. Enter a free USPS service that works in tandem with the IRS’ online stimulus check tracker to give you a more precise delivery window for peace of mind. 

Although the second stimulus checks are coming more quickly this time around, there’s also a catch: a Jan. 15 cutoff date to receive your check. If you don’t get your payment in the mail

Read More View More When will your new stimulus check come in the mail? Track it with this free USPS tool

How to use the grep command for better data retrieval

Automating the performance of tasks via scripting is something we all strive to do as IT pros. But taking it a step further by using grep adds a layer of granularity and universality to your scripts.

Image: iStock/HAKINMHAN

Interacting with data is the core function of any IT professional. Each role is unique and brings with it specific challenges, but at the heart of each role lies the same basic premise: As IT, we interpret and respond to the data we receive and if it isn’t accurate, we take measures to correct the data flow. When we automate tasks based on scripts, it is typically done in response to known parameters and provides a predetermined set of commands to execute, thereby automating repetitive tasks.

SEE: TechRepublic Premium editorial calendar: IT policies, checklists, toolkits, and research for download (TechRepublic Premium)

This is great and, I whole-heartedly recommend that IT pros automate where possible to maximize performance and limit downtime for all stakeholders. But what if you could execute commands or write scripts that would provide information and make changes (execute commands) based on the responses? You could automate tasks with a bit of logic baked in to allow for the script

Read More View More How to use the grep command for better data retrieval

How to configure macOS content caching for customized networks

Networks with advanced configurations or multiple ranges can sometimes pose a problem for macOS content caching, but with the correct setup, caching data can be easily attained.

Image: iStock/BartekSzewczyk

The content cache service baked into more recent versions of macOS is beneficial for organizations of all types and sizes to get the latest Apple updates, apps, and iCloud data to all the devices behind the company’s firewall.  In the case of iCloud documents, it can get users working productively a lot more quickly, as shared documents are updated in real time and made available to all who need them.

SEE: Future of 5G: Projections, rollouts, use cases, and more (free PDF) (TechRepublic

As someone who has managed large Apple-based infrastructures, I can attest to the boost in network performance, reduction in use of bandwidth, and timely updates that are provided to all devices across the network. One of the best parts about using the content cache service is that in most cases little to no additional configuration is required: The default setup works beautifully and immediately.

Since all networks are not created equal, sometimes with more specialized network configurations the content cache server will require tweaking to allow it to

Read More View More How to configure macOS content caching for customized networks