Search Results

Search: Posts Made By: gary_w
1,353
Posted By elixir_sinari
With sed (with some assumptions): echo...
With sed (with some assumptions):
echo "$str"|sed -n '/[^{]*{aaID=\([^;]*\);/{;s//\1\
/;P;D;}'
producing
z_701
S_300
x_500
2,076
Posted By elixir_sinari
Not a necessity if you have <<-EOF instead of...
Not a necessity if you have <<-EOF instead of <<EOF. In the former case, EOF may be preceded by tabs.
2,141
Posted By alister
It starts off very much like your original...
It starts off very much like your original attempt.

\|~DRG\|(\d+): Begins by looking for |~DRG|<some number>. The number is captured.

.*?: ... followed by a non-greedy wildcard, so it doesn't...
2,141
Posted By alister
This works with several variations I created from...
This works with several variations I created from your sample data:
perl -lpe 's/\|~DRG\|(\d+).*?(?=\|~(?!DCT))/$1>15?"":$&/ge' file

Regards,
Alister
3,652
Posted By Scrutinizer
Note: with read you can use IFS local to the read...
Note: with read you can use IFS local to the read command, so that you do not need to globally set/reset IFS :
IFS=: read field1 field2 field3 field4 < x.dat
3,208
Posted By Scrutinizer
Word boundaries are not specified in POSIX and...
Word boundaries are not specified in POSIX and are not universally available in grep. Most greps do have a -w switch:
$ echo bla bla connected | grep '\<connected\>'
$ echo bla bla connected |...
9,334
Posted By black_fender
In the main script can you try this : ...
In the main script can you try this :

instead

ssh faunus:/home/dslmain/scripts/senddcmcadefttest.sh
this :

ssh user@remote_machine "/home/dslmain/scripts/senddcmcadefttest.sh ; exit \$?"
...
Forum: Fedora 05-08-2012
6,009
Posted By Scrutinizer
$ cat floattest2 #!/bin/sh a=-0.5 b=1.3 ...
$ cat floattest2
#!/bin/sh
a=-0.5
b=1.3

if [ $a -le 0 ] || [ $b -ge 1 ]; then
echo Hello
else
echo Goodbye
fi


a=-0.5
b=1.3

if [ $a -lt 0 ] || [ $b -gt 1 ]; then
echo Hello 2...
2,497
Posted By agama
It would be safer to assign the values to an...
It would be safer to assign the values to an associative array making eval unnecessary and allowing for fairly simple verification of a valid name entered.


#!/usr/bin/env ksh

function prompt...
28,090
Posted By CarloM
Search 'RFC2822 regex' - the regular expression...
Search 'RFC2822 regex' - the regular expression for the official standard for addresses is, um, long :).
...
28,090
Posted By Scrutinizer
I would be inclined to prefer [^ \t@] to \w for...
I would be inclined to prefer [^ \t@] to \w for the bit before the @, since a surprising range of character are allowed in the local part of email addresses:
Email address - Wikipedia, the free...
4,169
Posted By jacobs.smith
I used the following command and it works fine...
I used the following command and it works fine for me

awk '{print >("input_" int((NR+4999)/5000))}' input.txt
6,222
Posted By alister
[m]intty is both a valid regular expression for...
[m]intty is both a valid regular expression for grep and a valid sh pattern for pathname expansion. If you don't quote that argument, and if the current working directory has a matching item, the...
3,210
Posted By vbe
What about your solution? We appreciate people...
What about your solution?
We appreciate people saying their issue is solved, we like even more when someone saying found a solution, show what they found...
5,986
Posted By Corona688
You redirect stdin to read the file. 'select'...
You redirect stdin to read the file. 'select' reads an option from stdin. So 'select' ends up reading from the file.. Open it into another fd, and read from that.

I'm not sure if it's -u5 or -u...
12,394
Posted By Chubler_XL
@gary_w if you strip out the path part of $0 you...
@gary_w if you strip out the path part of $0 you could report wrong file eg: ./ls would report /usr/bin/ls instead of /home/garyw/ls

On ksh it's probably best to use one of : realpath $(whence...
3,435
Posted By methyl
One way of achieving the effect of "-maxdepth 1"...
One way of achieving the effect of "-maxdepth 1" is to work from the directory above the one you are actually interrogating. Then apply the "-prune" to stop find searching deeper.

#!/bin/ksh...
3,435
Posted By verdepollo
Using "-prune" is essentialy the same as using...
Using "-prune" is essentialy the same as using "-maxdepth 1"

I'm assuming "full_path_to_dir_to_search" already contains a splat in order to create the list?


find...
3,435
Posted By birei
Hi gary_w, As I understand, the option you...
Hi gary_w,

As I understand, the option you are looking for is:

-maxdepth 1
which doesn't descend into directories.

Substitute '-prune' with '-maxdepth 1', and an absolute path doesn't mind....
23,948
Posted By vgersh99
exactly!
exactly!
23,948
Posted By durden_tyler
:%s/\(.*\)/'\1'/ => % = for all lines in...
:%s/\(.*\)/'\1'/ =>
% = for all lines in the current vim window
s = substitute
/ = start with the search expression hereafter (s/// syntax)
\( = escape character + begin...
18,130
Posted By alister
Take a close look at your quoting. You cannot...
Take a close look at your quoting. You cannot include a single-quote in a single-quoted string. Usually, that's done by closing the quoted string, escaping a single quote, and re-opening a quoted...
15,279
Posted By cero
@pludi: controlling SQL*Plus commands like spool...
@pludi: controlling SQL*Plus commands like spool with PL/SQL is hard, but SQL*Plus can be tricked to act conditional.

column spool_destination noprint new_value spooldestination
SELECT...
1,813
Posted By aigles
From crontab you can do : minute hour...
From crontab you can do :
minute hour day_of_month month day_of_week your_script.sh%1%yes%n%64

Jean-Pierre.
54,069
Posted By jim mcnamara
awk ' /^header/ && FNR > 1 {next} {print $0} '...
awk ' /^header/ && FNR > 1 {next} {print $0} ' infile > newfile
Showing results 1 to 25 of 30

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