Search Results

Search: Posts Made By: forrie
80,015
Posted By forrie
I got this to work: [[ $STRING =~...
I got this to work:


[[ $STRING =~ ^(one|two|three)$ ]] && echo hello


This also matches a hostname like

one-hostname


I'm running BASH

GNU bash, version 4.3.11(1)-release...
80,015
Posted By forrie
On CentOS 6.5, I am unable to get this to work...
On CentOS 6.5, I am unable to get this to work correctly (per above):

[[ $STRING =~ ^(one|two|three)$ ]] && do-something

The string will actually be a part of a hostname, for example...
80,015
Posted By forrie
So am I to infer from the responses that what I...
So am I to infer from the responses that what I am attempting to do cannot be done in this context within BASH?

FYI, this does not work:

[[ "$1" =~ "one|two|three" ]]

basically, I'm looking...
80,015
Posted By forrie
Using BASH =~ regex to match multiple strings
I have a scripting problem that I'm trying to solve, whereby I want to match that a string contains either of three strings. I'm thinking this is probably just me not understanding how to craft the...
2,897
Posted By forrie
Thanks, that is a much more elegant version of my...
Thanks, that is a much more elegant version of my messy solution above.

I need to learn awk/perl. Been putting it off too long.
2,897
Posted By forrie
Alright... tar ztvf: drwxr-xr-x 0/0 ...
Alright...

tar ztvf:

drwxr-xr-x 0/0 0 2011-07-26 17:20:44 FMS_4_0_3_r4011/conf/_defaultRoot_/
drwxr-xr-x 0/0 0 2011-07-26 16:51:28...
2,897
Posted By forrie
Extract root basedir name from a *.tar.gz file
I am working on a script to install a software distribution which ships as a *.tar.gz file. The company doesn't name the dist consistently, but the resulting directory out of the *.tar.gz file (ie:...
24,670
Posted By forrie
That doesn't work, as the next character is a TAB...
That doesn't work, as the next character is a TAB --

I'm still puzzled why the metacharacters \< and \> don't work for bounaries, too.

Thanks.
24,670
Posted By forrie
Searching for instance of specific IP in a file
I have a similar question, so I'll post it here.

I have a script that blocks IPs, but checks first to see if the given IP exists in a file before proceeding. In one case, it's /etc/mail/access...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 05:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy