Search Results

Showing results 1 to 40 of 399
Search took 0.04 seconds.
Search: Posts Made By: eggi
Forum: Shell Scripting Jun 28th, 2009
Replies: 4
Views: 773
Posted By eggi
Hey there,

If you're doing this for C, you can just use quotes instead of the angle brackets, like

#include "/home/yourdir/myInclude/header.sh"

If you're using a shell and your includes are...
Forum: Shell Scripting Mar 23rd, 2009
Replies: 11
Solved: turn mb to gb!
Views: 1,531
Posted By eggi
Hey Chris,

It looks like just a simple typo in Aia's reply. Just change $8.2f to %8.2f and you should get "1.20"

, Mike
Forum: Shell Scripting Mar 19th, 2009
Replies: 3
Views: 1,592
Posted By eggi
Hey there,

You could use the output of netstat and pipe that to a line count. Something like:

netstat -an |grep "[2]3"|wc -l

althought that might give you some false positives and you...
Forum: Shell Scripting Mar 19th, 2009
Replies: 4
Views: 1,116
Posted By eggi
Cool,

Good job :) I was going to suggest this for your if statement, but I guess I should have read farther down ;)



Either way's good :)

Best wishes,
Forum: Shell Scripting Mar 18th, 2009
Replies: 4
Views: 1,116
Posted By eggi
Hey Richard,

For both of those, you can capture the output of your test commands using backticks (will work in any shell) or the $() test in bash

For instance, you could take your statement:
...
Forum: Shell Scripting Mar 9th, 2009
Replies: 3
Views: 955
Posted By eggi
Hey,

Glad I could help. In the process, you taught me a cool trick. I never knew you could do that... all those years.... exiting over and over again just to get out of a terminal session. It...
Forum: Shell Scripting Mar 6th, 2009
Replies: 3
Views: 955
Posted By eggi
Hey there,

Sometimes it will work if you just replace your exec call with a simple direct call, so instead of:



just do

<-- Since you're not exec'ing (i.e. replacing the current process...
Forum: Shell Scripting Mar 5th, 2009
Replies: 2
Views: 752
Posted By eggi
Hey there,

This should work:



Best wishes,

Mike
Forum: Shell Scripting Mar 3rd, 2009
Replies: 2
Views: 459
Posted By eggi
Hey There,

Also, at the end of your code if you change:

echo "${name}:${phone}:${address}" >> addressbook.txt

to

echo "${name}:${phone}:${address}" > addressbook.txt
Forum: Shell Scripting Mar 3rd, 2009
Replies: 3
Views: 612
Posted By eggi
Good deal :)

Glad to help!

, Mike
Forum: Shell Scripting Mar 2nd, 2009
Replies: 3
Views: 612
Posted By eggi
Hey There,

You're probably running into an issue with -p if you're just using a plaintext password. It expects the password to be encrypted using the crypt program (apologies if my assumption is...
Forum: Shell Scripting Feb 27th, 2009
Replies: 4
Views: 1,318
Posted By eggi
Hey there,

That can be done. Try this first though, since I find that "human readable" output is usually off. I would grab the information in kb and convert that to Mb. It will probably be more...
Forum: Shell Scripting Feb 26th, 2009
Replies: 4
Views: 1,318
Posted By eggi
Hey There,

You coud use the output of format, although if you wanted to automate, you'd have to pipe the right commands to it and then do some processing on the other end, eg, for disk 0:


...
Forum: Shell Scripting Feb 11th, 2009
Replies: 4
Views: 720
Posted By eggi
Glad to have been part of the solution for once ;)

best wishes,

, Mike
Forum: Shell Scripting Feb 9th, 2009
Replies: 4
Views: 720
Posted By eggi
Hey there,

Just in case you have to do it the second way, this form works in bash 3.x (possibly earlier versions) and avoids the variable scoping problem while maintaining the integrity of the...
Forum: Shell Scripting Jan 31st, 2009
Replies: 3
Views: 747
Posted By eggi
Hey, ok, I see where you're coming from now :)

Actually, if you don't know where a particular process logs to, figuring that out from the process itself can be done, but it's not necessarily...
Forum: Shell Scripting Jan 29th, 2009
Replies: 5
Views: 998
Posted By eggi
That's an excellent suggestion, comatose. I also didn't realize what a huge pain this whole thing was for you, glamiss.

I think leaving the nice value at 0 (default) will make your program hog...
Forum: Shell Scripting Jan 29th, 2009
Replies: 3
Views: 747
Posted By eggi
Hey there,

I'm sure what you're shooting for but, maybe:

LOG=${PROCS}.log

$LOG "0"

or
Forum: Shell Scripting Jan 28th, 2009
Replies: 5
Views: 998
Posted By eggi
Hey there,

If you're running syslog-ng, look into that. It has a history of doing exactly what you're experiencing.

Otherwise, since you know this action is recurring (something is chmod'ing...
Forum: Shell Scripting Jan 27th, 2009
Replies: 7
Solved: awk print total
Views: 2,003
Posted By eggi
Hey There,

Two things, I think:

1. You're not stripping the literal dollar sign from the figures you're trying to add

2. Since you're invoking awk twice, you need to include your BEGIN...
Forum: Shell Scripting Jan 24th, 2009
Replies: 1
Views: 647
Posted By eggi
Hey There,

It might have to do with the user agent string that wget passes to the site (I think it's something like wget-version). You can manipulate the --user-agent= variable to pass anything,...
Forum: Shell Scripting Jan 22nd, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey again,

I sent you another PM - I think we have it this time (there's only, I think, one other option ;)

, Mike
Forum: Shell Scripting Jan 21st, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey again,

Yes, I did and (thank you so much for the find output) I realized that I have been misunderstanding you this entire time. I wrote you back via PM so as not to take up too much space,...
Forum: Shell Scripting Jan 20th, 2009
Replies: 2
Views: 830
Posted By eggi
Hey there,

Very basicly, it's an integer used to identy an open file in a process. In Unix/Linux/Posix 0, 1 and 2 are generally reserved for STDIN (standard input), STDOUT (standard output) and...
Forum: Shell Scripting Jan 19th, 2009
Replies: 2
Views: 1,162
Posted By eggi
Hey There,

Another way to go about it would be to do the math incrementally, within the loop, to avoid any possibility of losing the variables value when you exit the loop due to scope issues. ...
Forum: Shell Scripting Jan 19th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey There,

Okay - good :) As long as all you got back where directories and they were all named events1, events2, etc. If possible, can you PM me the output? If you're getting back any results...
Forum: Shell Scripting Jan 19th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey Again :)

Actually I was just asking if you could run either of those command from the command line (outside of the script) and see the output from those :)



all by itself should be good...
Forum: Shell Scripting Jan 18th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey,

Don't worry. You don't sound dumb. If you were dumb, you wouldn't ask questions ;)

Actually if you could do the find command with your full path and then the same with $EVENTDIR, that...
Forum: Shell Scripting Jan 18th, 2009
Replies: 2
Views: 719
Posted By eggi
Also, as Salem pointed out, don't forget to use the preceding $ character when you're extracting values from your variables.

Best wishes,

Mike
Forum: Shell Scripting Jan 16th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey there,

Well that's good news of a sort, since it's bringing us closer to an answer. Since that gives you same result from the CLI, I would take a look at this find statement:



on its...
Forum: Shell Scripting Jan 16th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Bummer,

BTW, can you let me know exactly what distro of Linux or Unix you're using? Then maybe I can replicate the problem just the same.

Also, I know these simple questions (no offense), but...
Forum: Shell Scripting Jan 15th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey There,

JUST FYI - IMPORTANT NOTE FOR YOU - You dotted out the top path, but didn't dot out the path in the bash -x output. If this is material you don't want put out for public consumption,...
Forum: Shell Scripting Jan 15th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey again,

The next thing to try would be to leave your cron entry the same, but on your shebang line in the script, instead of

#!/bin/bash

use

#!/bin/bash -x
Forum: Shell Scripting Jan 13th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey There,

Probably this line:



should have been written as
Forum: Shell Scripting Jan 11th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey,

No problem, glad to help out anyone who's willing to give it a shot and gets stuck. Happens to all of us :)

Here's a rewrite of that script (I didn't fully test the way it will work with...
Forum: Shell Scripting Jan 9th, 2009
Replies: 16
Views: 4,997
Posted By eggi
Aia is correct about crontab -e. It does do checking, which is why I put that at the other end of the pipe :)

Basically the reason your script failed is that you need to actually put the control...
Forum: Shell Scripting Jan 9th, 2009
Replies: 2
Views: 596
Posted By eggi
Hey There,

You can also use "diff -r -y" if your version of diff supports it. This will give you output like:



Just another option if you can use it :)

Best wishes,
Forum: Shell Scripting Jan 9th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey There,

You can work it in where you like, since you setup a lot of variables, but generally, I suppose, you could use the code



right around this part
Forum: Shell Scripting Jan 9th, 2009
Replies: 16
Views: 4,997
Posted By eggi
Hey, Great - I hope it works out :)

Just to answer your questions:

mgolvach@tlaum-pc1 ~ is just my command prompt from my x86 linux box

The DO NOT COPY header is put in there by crontab. ...
Forum: Shell Scripting Jan 9th, 2009
Replies: 26
Views: 2,901
Posted By eggi
Hey There,

I think I get what you're going for. You could use this inside your script to do what you want, I believe:

find /path/to/events -name "events*"|while read x
do
zip -r...
Showing results 1 to 40 of 399

 


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

©2003 - 2009 DaniWeb® LLC