Search Results

Search: Posts Made By: totziens
9,080
Posted By totziens
I don't have the authority to install anything I...
I don't have the authority to install anything I like in the server :(
9,080
Posted By totziens
Thanks, otheus. I tried the following...
Thanks, otheus.

I tried the following commands and the results are as follows. It's not really the command "id" cannot be found but it's the "-u" option giving problem (except when I used...
9,080
Posted By totziens
Just found out "id -u" does not work in some of...
Just found out "id -u" does not work in some of the machines. Not really sure why. Could be due to individual machine's configuration issue. Not very safe for me to use.

Found the following...
9,080
Posted By totziens
Thanks a lot. I think "id -u" works perfectly for...
Thanks a lot. I think "id -u" works perfectly for me to use in both cases.
9,080
Posted By totziens
Bourne script: Check for root and oracle user
I have 2 separate Bourne shell scripts with 2 questions in Sun O/S & UNIX environment.

Question 1: One of the scripts is supposed to be executed by "root" user only but cannot be executed after...
23,381
Posted By totziens
cfajohnson, unfortunately the decision is not...
cfajohnson, unfortunately the decision is not mine. I have to stick with whatever shell script that was previously developed. We have used a lot of Bourne shell.

Both of the following codes work...
23,381
Posted By totziens
I just hit a problem with sed. Sorry, I don't...
I just hit a problem with sed. Sorry, I don't quite understand the command sed.

x="http://10.222.11.112:866/a/bb/c/d"
echo $x
echo $x |sed 's/\(.*\):[0-9]\{4\}\(.*\)/\2/'

Output:...
23,381
Posted By totziens
Thanks a lot. You guys are really good. It...
Thanks a lot. You guys are really good.

It would be great if someone can explain:
sed 's/\(.*\):[0-9]\{4\}\(.*\)/\2/'

Thanks again
23,381
Posted By totziens
Substring in Bourne shell
Shell used: Bourne shell
Environment: UNIX in a Sun machine

I found myself struggling to figure out how to split a string. I kept wishing it's in Java that I can do it real quick.

Basically I...
17,570
Posted By totziens
Thanks a lot, pjottum. It works now
Thanks a lot, pjottum. It works now
17,570
Posted By totziens
Actually I tried this before but it failed. I...
Actually I tried this before but it failed. I could still see the error message. See the following:

> rm * >/dev/null
rm: No match.


> rm * 2>/dev/null
rm: No match.
17,570
Posted By totziens
Bourne Shell: Hiding error messages
I am executing commands as follows in Bourne shell script. Filenames/directory names for the deletion/copying are unknown:

rm *
rmdir <directory>
cp -p * <directory>

Sometimes when no file or...
10,241
Posted By totziens
I have just found the main cause of the problem....
I have just found the main cause of the problem. It's due to a simple mistake. The "echo $line" is the one that displays the data unnecessarily. It took me days trying to figure out. Should have...
16,948
Posted By totziens
Hi Era, Thank you very much. Your solution...
Hi Era,

Thank you very much. Your solution works perfectly the way I want it to be.

I just have to do a minor change as highlighted in red to make it work:

echo "Enter directory: \c"
b=`awk...
16,948
Posted By totziens
Era, yes, I noticed your "read -r" all the while...
Era, yes, I noticed your "read -r" all the while but I keep forgetting to tell you "-r" is not a valid option in my environment.

egrep will not help as well because during the read statement, the...
16,948
Posted By totziens
Just discovered something new to me. The value of...
Just discovered something new to me. The value of b, c and INPUT are all the same. Initially I thought I could compare the value of INPUT and b for identifying the backslash. The "\" is automatically...
16,948
Posted By totziens
Era, I have to agree that your case statement is...
Era, I have to agree that your case statement is the one closest to solving the problem. It's 99% working now.

As for "\", I have incorporated double backslash as follows:

case $b in
...
16,948
Posted By totziens
It does not seem to work for "\": >echo...
It does not seem to work for "\":

>echo "adfdffdg" | egrep -v "\"
egrep: syntax error
> echo "adfdffdg" | egrep -v "/\"
egrep: syntax error
16,948
Posted By totziens
Coded the following for the sake of testing but...
Coded the following for the sake of testing but the result is unreliable. I am getting "echo 111" forever:

C=`echo $b | tr -d [0-9A-Za-z]`
if [ ! -z $C ];then
echo "111"
else
echo "222";...
16,948
Posted By totziens
I had to replace all the "print" command to...
I had to replace all the "print" command to "echo":
INPUT=$b
TEST_INPUT=`echo $b | tr -d [0-9A-Za-z\-_/]`

[[ -z $TEST_INPUT ]] && echo "Input OK to proceed" || echo "Incorrect Input"
[[ -z...
16,948
Posted By totziens
When entering "889\", the cursor moves to the...
When entering "889\", the cursor moves to the next line expecting an input. I think it treated "\" with a special meaning.
16,948
Posted By totziens
I managed to reduce the number of invalid input...
I managed to reduce the number of invalid input with the following code. Basically, I need to place "/" at the back of the case statement. Otherwise "/" will cause problem to the character after it...
16,948
Posted By totziens
Yeah, I agree. I will do what I can first. ...
Yeah, I agree. I will do what I can first.

If anyone has a better solution, please let me know. I am still desperate for a solution. I regret for agreeing to use Bourne shell to develop this...
10,241
Posted By totziens
Thanks, again, Jean-Pierre. I tried those...
Thanks, again, Jean-Pierre.

I tried those setting, they're not effective either :(
10,241
Posted By totziens
I am actually working on 2 scripts. The process...
I am actually working on 2 scripts. The process is similar and facing the same problem.

It's funny that one of the script's update section calling the same stored procedure returning the same...
Showing results 1 to 25 of 42

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