Forum: Shell Scripting May 18th, 2009 |
| Replies: 3 Views: 833 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 |
Forum: Shell Scripting Sep 5th, 2008 |
| Replies: 2 Views: 980 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 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 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 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... |