Results 1 to 3 of 3
Hello,
does anybody have an idea, how to replace $0 (positional parameter, which stores function name inside function) within function within a shell(ksh8 script ?
f_somefunc () {
echo $0 ...
- 08-08-2008 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 5
Replace $0 within shell function
Hello,
does anybody have an idea, how to replace $0 (positional parameter, which stores function name inside function) within function within a shell(ksh8
script ?
f_somefunc () {
echo $0 #returns f_somefunc
%#$%#$ ="aaaa" #here is hint needed how to replace $0 value with aaaa
echo $0 #so in this step the echo returns aaaa
}
thank you very much
hm
- 08-08-2008 #2
The first question that comes to my mind is "Why?". $0 is a special variable. Even if you can change its value (which I'm not sure if you can), it makes your code more confusing to understand in the future, and I'm not sure that there's any point.
DISTRO=Arch
Registered Linux User #388732
- 08-12-2008 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 5
well, the main issue is that i have to source to my script another script, which i cant modify nor reject, as it is part of more global solution, and sourced script functions then use $0


Reply With Quote