Search Results

Search: Posts Made By: doc_symbiosis
3,795
Posted By doc_symbiosis
Howto make ksh skript bash-compatible with backticks
I have the following ksh-script:

#!/bin/ksh
# Ueberprüfe, ob genau ein Parameter angegeben wurde
test "$#" -eq "1" || { echo "USAGE: path_cleanup <PATH_NAME>"; return 1; }

# Ueberpruefe, ob...
25,146
Posted By doc_symbiosis
echo $TEST or env | grep TEST or ...
echo $TEST

or

env | grep TEST

or

export | grep TEST
25,146
Posted By doc_symbiosis
export variable from ksh script doesn't work
Hi there,

in a script I have

#!/usr/bin/ksh
TEST=hello
export TEST

Problem is, that the variable doesn't get exported. I also tried

typeset -x TEST=hello

When I put the two lines in...
15,849
Posted By doc_symbiosis
YEAH, that's it. Both solutions work like charm. ...
YEAH, that's it. Both solutions work like charm.

@Franklin52: except of the missing ` at the end of your line

Thank you both very much.

One last question: Where can I set the thread to...
15,849
Posted By doc_symbiosis
@Franklin52: With the export it is clear for me....
@Franklin52: With the export it is clear for me. It's only a question of getting the $PATH varaible cleaned up. I would do the export afterwards.
But your code doesn't work for me, besause I have...
15,849
Posted By doc_symbiosis
ah ok, the '''-n''' for echo didn't work on...
ah ok, the '''-n''' for echo didn't work on solaris.

PATH=`printf "$PATH" | /usr/xpg4/bin/awk -v RS=':' -v ORS=":" '!a[$0]++'`
So I have two lines as output. How can I now only use the first one...
15,849
Posted By doc_symbiosis
Didn't change anything, when I use PATH=`...
Didn't change anything, when I use

PATH=` echo "$PATH" | /usr/xpg4/bin/awk -v RS=':' -v ORS=":" '!a[$0]++'`


Also, with printf no change.
15,849
Posted By doc_symbiosis
Sorry, with echo -n didn't work on solaris. But...
Sorry, with echo -n didn't work on solaris. But there I used
printf "$PATH"
instead and the problem still remains...:(
15,849
Posted By doc_symbiosis
Very much thanks for the fast replies to both of...
Very much thanks for the fast replies to both of you.

I've have made this from the sample of rakeshawasthi

echo $PATH | awk -F":" '{for (i=1;i<=NF;i++){if (x[$i]++==0) print $i}}'


But I...
15,849
Posted By doc_symbiosis
cleanup $PATH with awk
Hello there,

I want to remove duplicate directories of $PATH. I already have the code (found in this forum), which removes duplicate lines in a textfile.
awk 'x[$0]++==0' filename

By how do I...
Showing results 1 to 10 of 10

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