Search Results

Search: Posts Made By: user052009
5,725
Posted By bakunin
Your solution is not only correct - it is so even...
Your solution is not only correct - it is so even to the extent that this will work in ksh88 too. In terms of parameter expansion ksh88 and ksh93 are very much identical.

Of course, in ksh88 you...
5,725
Posted By MadeInGermany
Still, this is string substitution. // is...
Still, this is string substitution.
// is global substitution (retry if successful)
/ is one substitution
Only ksh93 has it correctly implemented (and bash-4, while bash-2 and bash-3 have a little...
5,725
Posted By bakunin
Hmm, in this case i stand corrected. I only used...
Hmm, in this case i stand corrected. I only used it with the sh version in AIX (which is a ksh88) and there it works. So either it is a bug from porting it to Solaris or IBM fixed it when porting the...
5,725
Posted By RudiC
You need to post the ksh version that you use....
You need to post the ksh version that you use. ksh93 has "Parameter Expansion". man ksh:
In your case:

echo ${NAMES//$EXCLUDE_NAME}
John Paul George
In case $EXCLUDE_NAME contains several...
1,961
Posted By Scott
You can set user as mandatory by testing if it's...
You can set user as mandatory by testing if it's set (although you may want to use another variable name (USER is a shell variable)):

i.e.

while getops ...; do
...
done
...
if [ -z "$USR"...
3,212
Posted By Don Cragun
Let us take a close look at the command line you...
Let us take a close look at the command line you typed into your shell:
./test.ksh -username user1 -surname user2 -address abc123 -startdate 123 -req 4 -options -debug

If you look closely,...
4,840
Posted By Corona688
Change for arg ; do to for arg in $STR ; do ...
Change for arg ; do to for arg in $STR ; do

Beware that things like quotes-inside-quotes won't do what you want when you store arguments.
1,754
Posted By drl
Hi. Not knowing what your environment is,...
Hi.

Not knowing what your environment is, many systems utilize locate:
NAME
locate - find files by name

SYNOPSIS
locate [OPTION]... PATTERN...

DESCRIPTION
locate ...
1,754
Posted By RudiC
This is not related to ksh at all - you'll need...
This is not related to ksh at all - you'll need external commands for this. Try - if your find version allows for it -

find /u01/app/oracle/local -type d -iname target_dir -ls | sort -ksomekey...
1,754
Posted By jim mcnamara
ls -ldt `find /u01/app/oracle/local -type d |...
ls -ldt `find /u01/app/oracle/local -type d | head -1`

It does not make sense to request the most recent directory and then want a return code for an answer. This returns the ouptut for ls -l for...
1,840
Posted By RudiC
Unfortunately, in my proposal there's neither a...
Unfortunately, in my proposal there's neither a line 4 not a line 5. PLEASE get accustomed to post a decent context!
I guess ksh doesn't like the "Case Modification" Parameter Expansion known from...
1,174
Posted By chebarbudo
Hi general_franco, If you want to manually...
Hi general_franco,

If you want to manually force arguments, you can use :
set -- -dbversion 11.2.0.4.0 -type backup -host testhost
while [ -n "$1" ]; do

Regards
Santiago
1,394
Posted By Don Cragun
Hi Jim, No. No matter how many hard links...
Hi Jim,
No. No matter how many hard links there are to a file, that file only consumes one i-node.

If you have a bunch of symbolic links pointing to a regular file, the regular file and each...
3,857
Posted By RudiC
/dev/random supplies an seemingly infinite number...
/dev/random supplies an seemingly infinite number of random bytes (in fact limited to 32MB since linux 3.16), so your cat won't finish soon if at all,as the random generator won't send an EOF. (c.f....
1,743
Posted By apmcd47
I don't understand why you have your tar command...
I don't understand why you have your tar command embedded in a process substitution:
$(tar -zcvf $STAGE/${FILENAME} ${LOG}/*)
This would cause the output of tar (and you have it in verbose mode)...
2,725
Posted By Don Cragun
I don't see the purpose of extracting the...
I don't see the purpose of extracting the variable base from $f. Given that you start by creating ${BASEDIR}/num_0 and strip off ${BASEDIR}/ and then strip off _0 (or _ followed by some other string...
2,102
Posted By drl
Hi. The utility paste: paste -d, - - - <...
Hi.

The utility paste:
paste -d, - - - < your-file-name
produces
option1=123,option2=abc,option3=321
Bes wishes ... cheers, drl
2,679
Posted By rbatte1
... or perhaps this:- 1)...
... or perhaps this:-
1) print "Running option 1: $file\n"; (nohup ${BASE}/run_test ${file} > /dev/null 2>&1) & _RC=$? ; [[ $_RC -ne 0 ]] && exit 1

I've dropped the leading $...
2,679
Posted By rdrtx1
1) print "Running option 1: $file\n"; { nohup...
1) print "Running option 1: $file\n"; { nohup ${BASE}/run_test ${file} > /dev/null 2>&1 ; } & ; _RC=$? ; [[ $_RC -ne 0 ]] && exit 1";";";
2,725
Posted By Chubler_XL
${f##*/} uses Remove matching prefix pattern to...
${f##*/} uses Remove matching prefix pattern to expand variable f and remove all characters up to and including the last slash (/) character from the expansion. So if f contains /one/two/three/four...
3,264
Posted By Don Cragun
The regular sed command Scrutinizer suggested: ...
The regular sed command Scrutinizer suggested:
sed -e 's/^&\([^&]\)/\&\&\1/; s/\([^&]\)&$/\1\&\&/' -e :L -e 's/\([^&]\)&\([^&]\)/\1\&\&\2/g; t L' file
could also be written as:
sed -e...
3,264
Posted By Peasant
I find sed scripts with a lot of escapes much...
I find sed scripts with a lot of escapes much more readable if other separator is used.


Same code Rudi posted is much more readable and does the same :

sed ':L;...
3,264
Posted By RudiC
Had you posted a meaningful input sample, a...
Had you posted a meaningful input sample, a better solution could have been offered. Try
sed ':L; s/\(^\|[^&]\)\(&\)\([^&]\|$\)/\1\2\2\3/g; tL' file
&&

&&

&&

&&&

&& && &&
&& && &&&&&&
34,079
Posted By vertigo23
Here ya go
Provided you have netcat installed, this should run pretty quickly.


for port in {1..65536}; do
nc -zv 127.0.0.1 $port 2>&1
done | grep open


Netstat will also tell you what programs...
7,127
Posted By rbatte1
I don't see MSSQL mentioned earlier and I missed...
I don't see MSSQL mentioned earlier and I missed the point about them being Gateway as opposed to plain database listeners, but how about this suggestion:-

Select a range of ports that are free
...
Showing results 1 to 25 of 28

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