Search Results

Search: Posts Made By: aster007
3,332
Posted By RudiC
This might work: echo 'His phone number is...
This might work:
echo 'His phone number is (123) 456-7890 and account is 34567 887272. ' | awk '
{while (match ($0, /[0-9()-]+ *[0-9()-]*/)) {X = substr ($0, RSTART, RLENGTH-4)
...
3,332
Posted By vgersh99
this is a bit convoluted - others might find a...
this is a bit convoluted - others might find a better, more generic approach - this is brute-force:

$ echo 'His phone number is (123) 456-7890 and account is 34567 887272. ' | \
awk '
...
3,332
Posted By vgersh99
It's slightly more complicated than that - look...
It's slightly more complicated than that - look at the sample input/output examples.
9,921
Posted By bakunin
Use ksh instead bash. You are probably used to...
Use ksh instead bash. You are probably used to ksh anyway when you come from AIX and it is available on every Linux since some time now. When using ksh you have the shell-internal "print" for output....
9,921
Posted By cjcox
Ok... so in general we have an old SysV vs....
Ok... so in general we have an old SysV vs. Berkley... or perhaps a ksh vs. Berkley-ism.

I too was somewhat displeased with the Linux choice of a BSD-ish like echo since it tried to be more POSIX...
10,318
Posted By Corona688
Try adding a newline before and/or after the...
Try adding a newline before and/or after the --boundary line.
1,555
Posted By Yoda
awk '/SNAPSHOT/{print ++c". The snapshot "$2" is...
awk '/SNAPSHOT/{print ++c". The snapshot "$2" is created by volume: "$3;}' filename
34
80,521
Posted By ungalnanban
Vim tips and tricks
Vim Tips and Tricks


Save and quit



:w => Save [:w filename writes the content to the specified file from current file]

:q => Exit as long as there have been no changes

:q! =>...
2,590
Posted By complex.invoke
#!/bin/bash # # transpose ...
#!/bin/bash
#
# transpose

transpose()
{
awk '
{
if(max_nf<NF)
max_nf=NF
max_nr=NR
for(x=1; x<=NF; ++x)
...
148,718
Posted By complex.invoke
Tetris Game -- The Art Of Shell Programming
GitHub - deepgrace/tetris: Tetris implementation in all kinds of Programming Languages (https://github.com/deepgrace/tetris)

Usage: bash Tetris_Game [ <runlevel> [ <previewlevel> [ <speedlevel> [...
1,102
Posted By alister
The problem is that you aren't setting the value...
The problem is that you aren't setting the value of FS until _after_ the first record has already been read and split. That first line is being split on whitespace. Since there is none, $3 is empty....
2,810
Posted By Perderabo
This syntax is legal and it should work fine in...
This syntax is legal and it should work fine in ksh, bash, or even the old Bourne shell.

$ ROWSTOLOAD=""
$ export ROWSTOLOAD=${ROWSTOLOAD:--100}
$ env | grep ROWS
ROWSTOLOAD=-100
$



edit...
3,107
Posted By jim mcnamara
two points - I disagree with in2nix. ...
two points -

I disagree with in2nix.
find's behavior is largely very consistent, expecially on versions of UNIX that are POSIX-compliant.

find uses the stat() system call. This returns...
3,107
Posted By in2nix4life
ls -ld 1607570a-4fed44bb-4988 drwxr-xr-x 2 xxxx...
ls -ld 1607570a-4fed44bb-4988
drwxr-xr-x 2 xxxx xxxx 40 Jun 29 01:02 1607570a-4fed44bb-4988

find . -mtime +13 -type d
./1607570a-4fed44bb-4988
3,233
Posted By Franklin52
This is Useless Use of Cat...
This is Useless Use of Cat (http://partmaps.org/era/unix./award.html)
cut -f1 -d":" <file>
1,920
Posted By michaelrozar17
Through sed.. grep 'number wasnt' logfile.txt...
Through sed..
grep 'number wasnt' logfile.txt |head -2| sed "s/^.*(\([^)]*\)).*(....\(.*\)).*'\(.*\)'.*/\1 \2 \3/"
1,920
Posted By cgkmal
Sure OMLEELA, I'll try to explain good...
Sure OMLEELA,

I'll try to explain good enough :D

I'm using gensub function with regexp back reference feature, This feature within gensub works something like this:

gensub(/regexp/,...
4,650
Posted By jim mcnamara
in /etc/profile or the .profile of some selected...
in /etc/profile or the .profile of some selected users:

alias somecmd='/path/to/myscript'


#!/bin/ksh
# myscript: dummy wrapper for somecmd
# disallow -l
echo "$@" grep -q '-l'
if [ $?...
1,687
Posted By Corona688
A race condition would be like, if they were...
A race condition would be like, if they were trying to both write to the same file on disk simultaneously. Process 1 writes "hello", process 2 writes "world", you could get "helloworld",...
1,687
Posted By alister
It depends on what the scripts are doing. If you...
It depends on what the scripts are doing. If you have multiple scripts running at the same time and working with and modifying the same resources, you will likely experience unpredictable behavior...
Showing results 1 to 20 of 20

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