Search Results

Showing results 1 to 34 of 34
Search took 0.01 seconds.
Search: Posts Made By: Gromit ; Forum: Shell Scripting and child forums
Forum: Shell Scripting May 18th, 2009
Replies: 3
Views: 833
Posted By Gromit
Or do you mean the full path to the bash binary?

$ which bash
/bin/bash
Forum: Shell Scripting May 5th, 2009
Replies: 2
Views: 951
Posted By Gromit
Hi!

That sounds interesting, but I think we're a little unclear about the details. You mention...

"create a menu which will add users doing this in Bash"

...and...

"then adding a list of...
Forum: Shell Scripting May 5th, 2009
Replies: 3
Views: 472
Posted By Gromit
Hmm... Is that the whole script? I'm not seeing the "users" function called anywhere, or even a terminating "}" for the function :)

-G
Forum: Shell Scripting May 5th, 2009
Replies: 2
Views: 655
Posted By Gromit
That's really odd... It works OK on my system:


$ sed -f DBACheck.sql.sed DBACheck.sql
select granted_role from sys.dba_role_privs where grantee='SYSTEM';



What version of sed are you...
Forum: Shell Scripting Dec 30th, 2008
Replies: 3
Views: 1,501
Posted By Gromit
Here's a link that might get you started:

http://www.orafaq.com/wiki/SQL*Plus_FAQ#What_is_SQL.2APlus_and_where_does_it_come_from.3F

Experiment with care!
Forum: Shell Scripting Dec 30th, 2008
Replies: 3
Views: 1,501
Posted By Gromit
Sure! I don't have any examples in front of me, but the Oracle command line client is sqlplus. There are others, but I think sqlplus is the one that ships with Oracle. You should be able to script...
Forum: Shell Scripting Nov 20th, 2008
Replies: 3
Views: 1,279
Posted By Gromit
Check out "read"! It will take the user input and do whatever you want with it.


read -p "what is your name? " name
echo "Nice to meet you $name"


Hope that helps!
-G
Forum: Shell Scripting Nov 13th, 2008
Replies: 1
Views: 858
Posted By Gromit
Looks like you need to enclose your $line|sed in both cases! Try this:


for line in $(ls *.new); do
file1="${line}"
file2="$(echo ${line} | sed 's/\(.*\)..../\1/')"
diff ${file1}...
Forum: Shell Scripting Nov 7th, 2008
Replies: 3
Views: 672
Posted By Gromit
Do you use the temporary file for anything in the meantime? I'm biased against temporary files when they can be avoided, personally... Why not stuff it all into a variable and then stuff it into a...
Forum: Shell Scripting Nov 7th, 2008
Replies: 3
Views: 1,074
Posted By Gromit
Okay, I needed something to get my mind off work for a few minutes, so here's a quick script I wrote using both of the suggestions above from chris5126 and omrsafetyo. I didn't translate the date, I...
Forum: Shell Scripting Nov 5th, 2008
Replies: 1
Views: 912
Posted By Gromit
Wow, that's a lot of pipes! I would do it something like this:


awk '{TotCPU += $1}{TotMem += $2}END{print "Total CPU= " TotCPU "\nTotal Mem= "TotMem}' test.list


Kinda ugly all in one...
Forum: Shell Scripting Nov 5th, 2008
Replies: 2
Views: 1,207
Posted By Gromit
Hi!

The problem is that you're not providing a database name! Try this:


mysql -uusername -ppassword database_name ...



Hope that helps!
Forum: Shell Scripting Nov 4th, 2008
Replies: 4
Views: 648
Posted By Gromit
I keep a copy of this document posted at every workstation in my office ;)

http://www.digilife.be/quickreferences/QRC/vi%20Quick%20Reference.pdf

Enjoy!
-G
Forum: Shell Scripting Nov 4th, 2008
Replies: 4
Views: 648
Posted By Gromit
It's just a text file right? What flavor of Unix are you using? You'll probably want to use "vi" or "emacs". If you're not familiar with either of those, you'll probably want to google for some...
Forum: Shell Scripting Oct 12th, 2008
Replies: 2
Views: 1,865
Posted By Gromit
Heya Robert72! Did you find what you were looking for, or did you need more specific examples?

-G
Forum: Shell Scripting Oct 8th, 2008
Replies: 2
Views: 1,865
Posted By Gromit
I think you're looking for read -p

I have some examples, but running to a meeting... If you still need help, I'll post it later!

-G
Forum: Shell Scripting Oct 8th, 2008
Replies: 5
Views: 1,238
Posted By Gromit
Doesn't tripwire write a to a report file by default? Maybe you could get the results you're looking for by running tripwire and then parsing the report?

Otherwise, I think you're just missing...
Forum: Shell Scripting Oct 1st, 2008
Replies: 5
Views: 2,209
Posted By Gromit
This may be late, but I wanted to get the "column" command into the fight!


$ column -t -s " " test.txt
aba bba baba
abba baba baaa
addd ffff fffff


Hope this helps!
Forum: Shell Scripting Sep 30th, 2008
Replies: 3
Views: 895
Posted By Gromit
Hi Ajay!

I'm not that familiar with Java, so are the System.out messages what gets printed on the command line?

If' so, you'll want to run your java app like this:

./java-app >> log.txt

...
Forum: Shell Scripting Sep 30th, 2008
Replies: 4
Views: 874
Posted By Gromit
Okay, I think I'm confused now. It sounds like you just need to run that file as a shell script.

# sh ./file


Unless there's a reason to run it line-by-line... If you can't run it in place...
Forum: Shell Scripting Sep 29th, 2008
Replies: 4
Views: 874
Posted By Gromit
Hi Jaoqua!

How have you tried so far? Depending on how the file is formatted (are there spaces in some of the commands you want to run?) it should be as simple as:


for i in $(cat...
Forum: Shell Scripting Sep 23rd, 2008
Replies: 8
Views: 2,550
Posted By Gromit
Hi Manik, you might want to start a new thread, since this was was solved back in March :)

If this isn't what you're looking for, please start a new thread with more details. From what you've...
Forum: Shell Scripting Sep 22nd, 2008
Replies: 10
Views: 2,570
Posted By Gromit
This is a really interesting project. I'd like to take a deeper look into it when I have some time :)

Although I love bash a lot, Perl has a lot of built in functions to handle the conversions...
Forum: Shell Scripting Sep 22nd, 2008
Replies: 3
Views: 1,150
Posted By Gromit
OR you could break it up into functions!

Make each part of the script into a function, and you can go back to whatever function you want at any time.

For example, you can turn that initial...
Forum: Shell Scripting Sep 22nd, 2008
Replies: 1
Views: 1,136
Posted By Gromit
Hi Nick,

We'll need a little more info to help you I think. You say you know about mysqldump, so I assume you just need to know how to script a mysql dump for each database?

If that's the...
Forum: Shell Scripting Sep 22nd, 2008
Replies: 3
Views: 1,072
Posted By Gromit
Hi Rast,

To do this with find, try the -cmin switch:


-cmin n
File’s status was last changed n minutes ago.


EDIT: Or you might be looking for this one:
Forum: Shell Scripting Sep 22nd, 2008
Replies: 6
Views: 1,853
Posted By Gromit
If all that's in that directory is the sym links to the files that you want to tail, try something like this:


for i in $(ls /path/to/directory); do tail -n 21 $i; done


Let us know how it...
Forum: Shell Scripting Sep 8th, 2008
Replies: 7
Views: 1,487
Posted By Gromit
I poked at your original script and made some syntax changes to your "if" statement. I think it does what you want now. I think you have to use brackets when doing a comparison like this:


$...
Forum: Shell Scripting Sep 8th, 2008
Replies: 7
Views: 1,487
Posted By Gromit
Try this!


ps -C bash -o pid=,size | awk '{SUM += $2} END {print SUM}'


The problem is that your awk statement doesn't have a "print" command. You have to tell it what to print.

I also...
Forum: Shell Scripting Sep 5th, 2008
Replies: 10
Views: 2,570
Posted By Gromit
Nice! Looks like fun ;)
Forum: Shell Scripting Sep 5th, 2008
Replies: 2
Views: 980
Posted By Gromit
There are thousands of ways to do this one :) Try this!


grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /var/lib/output


Thanks!
-G
Forum: Shell Scripting Sep 5th, 2008
Replies: 10
Views: 2,570
Posted By Gromit
Here's a test I wrote just to see if my math was right :)


#!/bin/bash

if [ -z "$1" ]
then
echo "Usage: $0 <hex#>"
exit
fi
Forum: Shell Scripting Sep 5th, 2008
Replies: 10
Views: 2,570
Posted By Gromit
That's an interesting one... is the pattern for each one the same as your example?

If so, you could do something like:


TEST=(A028) ; echo -n ${TEST:2:4}${TEST:0:2}


Maybe? I dunno...
Forum: Shell Scripting Sep 5th, 2008
Replies: 6
Views: 2,619
Posted By Gromit
Hi!

I think Rad' meant to put quotes around the variable, like "$1". I don't think that's going to help though. This problem used to frustrate me so much!

Okay, I'm not sure how this will...
Showing results 1 to 34 of 34

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC