01-07-2013
You didn't say what the name was for the file that contains your "initial data". Both of the scripts I provided assume that the text you want to process is in a file named in. I've tried both of them on Mac OS X Version 10.7.5. Since OS X is a Mac OS X system (not a Solaris system), use awk.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
from the gnu sed manual, I should be able to do this:
`\(REGEXP\)'
Groups the inner REGEXP as a whole, this is used to:
* Apply postfix operators, like `\(abcd\)*': this will search
for zero or more whole sequences of `abcd', while `abcd*'
... (3 Replies)
Discussion started by: Allasso
3 Replies
2. Shell Programming and Scripting
Why is only hello3 being printed? There must be some kind of syntax problem because the file list definitely includes all the file extensions line by line.
#!/bin/bash
find '/home/myuser/folder/' -name '*.c' -type f | while read F
do
if ] # if the file name ends in .txt.c
then
... (6 Replies)
Discussion started by: cyler
6 Replies
3. Shell Programming and Scripting
Hi,
I'm trying to validate if a string matches a regular expression, but it is not working. Am I missing something? Do I need to scape any of the characters?
if echo 'en-GB' | egrep '({1,8})(-{1,8})*' >/dev/null; then
echo Valid value
fi
Thanks in advance (6 Replies)
Discussion started by: skrtxao
6 Replies
4. UNIX for Dummies Questions & Answers
%%%%% (9 Replies)
Discussion started by: lucasvs
9 Replies
5. Shell Programming and Scripting
I am trying to write my gsub regex to replace a bunch of special characters with spaces, so i can split it to an array and look at each word independently.
However, my regex skills are slightly lacking and I appear to be missing a quote or something here.
I am trying to replace the following... (6 Replies)
Discussion started by: nitrobass24
6 Replies
6. Shell Programming and Scripting
Using BASH:
$ if -- ::00" ]]; then echo "true"; else echo "false"; fi
false
Mike (5 Replies)
Discussion started by: Michael Stora
5 Replies
7. Shell Programming and Scripting
I am using a regex to exactly match a string abcdef as ^abcdef$. But it does'nt seem to work :( (11 Replies)
Discussion started by: gaurav99
11 Replies
8. Shell Programming and Scripting
Hello to all,
The Regex below is supposed to match all strings except RR45. I've tested in regex101.com and it works, butwhen I try to use it with the perl command below I get the error shown.
Regex=(?<=^|RR45)(?!RR45).+?(?=RR45|$)
How to fix this? I'm using Cygwin.
$ echo... (9 Replies)
Discussion started by: Ophiuchus
9 Replies
9. Shell Programming and Scripting
Hi Experts,
Need your kind help with gsub awk.
Below is my pattern:"exec=1_host_cnt=100_dup=4_NameTag=targetSrv_500.csv","'20171122112948"," 100"," 1"," 1"," 4","400","","",
" aac sample exec ""hostname=XXXXX commandline='timeout 10 openssl speed -multi 2 ; exit 0'"" ","-1","-1","1","... (6 Replies)
Discussion started by: pradyumnajpn10
6 Replies
SCSELECT(8) BSD System Manager's Manual SCSELECT(8)
NAME
scselect -- Select system configuration "location"
SYNOPSIS
scselect [-n] [new-location-name]
DESCRIPTION
scselect provides access to the system configuration sets, commonly referred to as "locations". When invoked with no arguments, scselect
displays the names and associated identifiers for each defined "location" and indicates which is currently active. scselect also allows the
user to select or change the active "location" by specifying its name or identifier. Changing the "location" causes an immediate system re-
configuration, unless the -n option is supplied.
At present, the majority of preferences associated with a "location" relate to the system's network configuration.
The command line options are as follows:
-n Delay changing the system's "location" until the next system boot (or the next time that the system configuration preferences are
changed).
new-location-name
If not specified, a list of the available "location" names and associated identifiers will be reported on standard output. If specified,
this argument is matched with the "location" names and identifiers and the matching set is activated.
SEE ALSO
configd(8)
HISTORY
The scselect command appeared in Mac OS X Public Beta.
Mac OS X November 4, 2003 Mac OS X