Search Results

Search: Posts Made By: felipe.vinturin
9,802
Posted By felipe.vinturin
This will change all the password that are the...
This will change all the password that are the same in one execution:
OIFS="${IFS}"
IFS="="
awk '/^Password|^hostPassword/ {print $0}' test.file | sort | uniq | \
while read key value
do
...
21,475
Posted By felipe.vinturin
What is your OS and what shell are you using?
What is your OS and what shell are you using?
21,475
Posted By felipe.vinturin
In shell, I don't know a way to keep an Oracle...
In shell, I don't know a way to keep an Oracle connection opened (and I don't think there is a way, sqlplus does not support it!).

By the way, if you want this, why the first piece of code I wrote...
21,475
Posted By felipe.vinturin
It is still not clear to me what you want, but...
It is still not clear to me what you want, but let see: you want to execute sqlplus for every Id you find, is that right?

$ cat testScript.sh
execSQLPlus ()
{
deptNo="${1}"
sqlplus -S -L...
21,475
Posted By felipe.vinturin
Check the code below: $ cat testScript.sh ...
Check the code below:

$ cat testScript.sh
buildSQLPlusExecStr ()
{
unset sqlStr

arrayCountPos=0
arrayLastPos=${#FileName[@]}
while [ ${arrayCountPos} -lt ${arrayLastPos} ]
do...
3,102
Posted By felipe.vinturin
Can't you escape the "-" before executing "grep"?...
Can't you escape the "-" before executing "grep"?

Check below:

$ text="-8x7YTVNk2KiuY-PWG5zzzjB-zzw"
$ string="-8x7YTVNk2KiuY-PWG5zzzjB-zzw"
$ echo "${text}" | sed 's/^-/\\-/g'...
1,398
Posted By felipe.vinturin
My opinion may not be important to you: I think...
My opinion may not be important to you: I think your script works, but it makes no sense (as I commented above) and I can't understant why you can't say it to your "client"!

As verdepollo...
1,398
Posted By felipe.vinturin
I don't think so! Inside the while loop you...
I don't think so!

Inside the while loop you are using "static" variables: CDR_SOURCE and CDR_DEST. Maybe you want this:

#!/bin/sh

CDR_SOURCE=/storage/archive/logmgmt/result/billing/*...
6
1,716
Posted By felipe.vinturin
Check the code below: ...
Check the code below:


tempFile="./fridayDate.tmp"
##########################################################
checkRetCode ()
{
lastRetCode=$?
if [ ${lastRetCode} -ne 0 ]
then
echo...
6
1,716
Posted By felipe.vinturin
Check this function: $ cat nextFriday.sh ...
Check this function:

$ cat nextFriday.sh
getNextFridayDate()
{
currentDayName=`date +"%A"`
currentDate=`date +"%Y%m%d"`
countDays=1
while [ "${currentDayName}" != "Friday" ]
do...
930
Posted By felipe.vinturin
Have you tried: netstat -i | awk '{print $4}'
Have you tried:

netstat -i | awk '{print $4}'
2,087
Posted By felipe.vinturin
Please, put an example of the output for the...
Please, put an example of the output for the input above!

It is not clear what you want (at least to me!).
5,960
Posted By felipe.vinturin
In the topic below you will find some ways to...
In the topic below you will find some ways to execute sqlplus:
-----> https://www.unix.com/shell-programming-scripting/171799-component-pak_popl_suppl-must-declared-error.html...
37,368
Posted By felipe.vinturin
I know that there are better ways (simplest,...
I know that there are better ways (simplest, fastest, most direct, etc) to do scripting and also that the "$()" is much better than using backsticks!

But as you commented, that's the way I am used...
37,368
Posted By felipe.vinturin
You are right! But that is the way I like to do...
You are right! But that is the way I like to do it! I think the code is easier to read this way! ;)
37,368
Posted By felipe.vinturin
Have you checked: "grep -i" option? echo...
Have you checked: "grep -i" option?


echo "Enter name to search"
read n
countFound=`grep -ic "${n}" file`
if [ ${countFound} -ne 0 ]
then
echo "name found"
else
echo "Not Found"...
2,376
Posted By felipe.vinturin
One of points you commented, maybe JUnit help...
One of points you commented, maybe JUnit help you:
-----> JUnit - Tutorial (http://www.vogella.de/articles/JUnit/article.html)
-----> Java(TM) Boutique - Unit Testing Java Programs...
2,787
Posted By felipe.vinturin
So, if you don't know userB's password, how you...
So, if you don't know userB's password, how you want to execute a script/command as it? You can setup "sudo", but you will need root's password for it!

Check this link:
-----> Quick HOWTO : Ch09...
3,588
Posted By felipe.vinturin
Check these links: -----> linux run startup -...
Check these links:
-----> linux run startup - Pesquisa Google (http://www.google.com.br/search?sourceid=chrome&ie=UTF-8&q=linux+run+startup)
-----> Run scripts at system startup on Linux...
1,466
Posted By felipe.vinturin
If you want to keep files, you can use the...
If you want to keep files, you can use the following logic:


# In this case it will look for directories from 30 until 50 (30 + 20) days ago!
countValBack=20
initVal=30
countValues=`expr...
10,574
Posted By felipe.vinturin
Another way with "stty": $ cat noEchoPass.sh...
Another way with "stty":

$ cat noEchoPass.sh
sttySettings=`stty -g`
echo "Password: "
stty -echo
read pass
stty "${sttySettings}"
echo "pass: [${pass}]"
$ ./noEchoPass.sh
Password:
pass:...
2,787
Posted By felipe.vinturin
You can use, logged as userA: su - userB -c...
You can use, logged as userA:

su - userB -c <script>
# Also, you can use sudo. Check its man pages!


I hope it helps!
5,742
Posted By felipe.vinturin
You can put the script to execute on:...
You can put the script to execute on: /etc/profile, because this file is loaded whenever a user logs and it would be something like:

specialUser=`echo "${USER}" | egrep -ic '^X'`
if [...
3,916
Posted By felipe.vinturin
This: # eval "myVar=\$${i}" # echo "myVar:...
This:

# eval "myVar=\$${i}"
# echo "myVar: [${myVar}]"


"myVar" will have the content of variable pointed by: "${i}". But be careful: eval is evil!
14,309
Posted By felipe.vinturin
@methyl That't why I wrote it was not going to...
@methyl
That't why I wrote it was not going to work! Also, your solution does what the OP wants! =)
Showing results 1 to 25 of 312

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