- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 9
- Posts with Upvotes
- 9
- Upvoting Members
- 6
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Unix/Linux Administrator
- Interests
- writing, computers, guitar
Re: Hey There, You may just need to remove one argument from your uuencode line so [QUOTE]/usr/bin/uuencode $file.Z $file.Z | /usr/bin/mailx -s "Report for COB $YESTERDAY" "joe.blogs@hotmail.com"[/QUOTE] becomes [QUOTE]/usr/bin/uuencode $file.Z | /usr/bin/mailx -s "Report for COB $YESTERDAY" "joe.blogs@hotmail.com"[/QUOTE] you can also user tar and gzip (if you have the Gnu version … | |
Re: If you're interested in building an OS, you should also get into c and c++ programming. If you look around hard enough you can find lots of good tutorials. A lot of times, even O'Reilly books show up online on overseas .edu sites. Good luck :) , Mike | |
Re: Hey There, You can also try [ICODE]HELO whateveryourdomainis.com[/ICODE] and see if the mailserver isn't just dishing you for not identifying your origin. or try [ICODE]EHLO ..etc, etc, etc[/ICODE] and, like omrsafetyo mentioned, you'll probably need to authenticate. Best wishes, Mike Maybe, maybe not.[QUOTE=subhashmedhi;648762]But if i use the following code [code] … | |
Re: a's got 100 b's got 9 you need the 91 uniques - I'll put 'em in c.txt [CODE]while read line do grep $line b.txt >/dev/null 2>&1 if [ $? -ne 0 ] then echo $line >>c.txt fi done <a.txt[/CODE] Sorry - just needed to drop a post somewhere - it's … | |
Re: Hey There, What you're trying to do is possible, if you use a program like "expect" to pass your password interactively (well, mock-interactively ;) to ssh and/or scp. However, your downside security wise would be much steeper than setting up dsa keys and strict trust (user@ip, etc). Are you avoiding … | |
Re: You can also "cut" out the first field before you sort, if you want :) , Mike | |
Re: Hey There, You should be able to do this with vi (assumming your EDITOR environment variable is set to vi). First, check out this article on how to "really" insert control characters into your scripts (like ^H backspace rather than a ^ symbol followed by a capital H): [url]http://linuxshellaccount.blogspot.com/2007/10/how-to-really-represent-control.html[/url] Then, … | |
Re: Hey there, If you're interested, just for kicks, here's the long convoluted way to do it :) [url]http://linuxshellaccount.blogspot.com/2008/01/unix-and-linux-shell-script-to-remind.html[/url] Cheers, Mike | |
Re: Hi there, It's probably expecting a reply to the password: prompt from su. You can make it all one line and get away with it, but you'd still have to enter 3 passwords (assuming you're not su-ing postgres as root) - one for the su - one for the createuser … | |
Re: Hey There, Your getting the result from the backticks is valid. I can't be sure about the mysql() function that you're referencing though. Can you post that? Thanks, , Mike | |
Re: You're pretty much there. I usually use sendmail, so pardon the substition. I think it's either output redirection or the mail command, but this should work (assuming your command works when run at the command line!) [CODE]37 01 24 1 * (echo "Subject: file compare output";/usr/local/bin/perl /tpf106/data2/cis_web/cis3/cis3.11/work/rishi/s-branch/perl1/perl/compare.pl 2>&1)|/usr/lib/sendmail rishi83@yahoo.in[/CODE] | |
Re: Hey There, This link probably answers all of your questions. Just pick the compiler you'll be using to build the package and they should have it listed (if not, use yum or apt-get to grab it and all it's dependencies) [url]http://opencvlibrary.sourceforge.net/CompileOpenCVUsingLinux[/url] Happy building :) , Mike | |
Re: Hey There, I think the easiest thing, and which might cut out some other problems for you, is to source the environment (user or global) into the script. For instance: #!/bin/ksh . /etc/profile # Read in the system profile . /home/user/.profile # read in the users profile That way you're … | |
Re: Hey there, If you're doing this for C, you can just use quotes instead of the angle brackets, like [CODE]#include "/home/yourdir/myInclude/header.sh"[/CODE] If you're using a shell and your includes are functions, you can put them in your .profile, as advised above or just create your header.sh file and source it … | |
Re: Hey There, You can try piping everything to sendmail -t (mail and mailx use sendmail). The -t flag means you have to specify headers, though, so: [CODE](echo "Subject: My Subject";echo "From: my@address.com";echo "To: your@address.com";echo "Reply-To: my@address.com";echo "X-Whatever: Any Other Headers You Want To Include";echo CONTENT;cat FILE)|/usr/lib/sendmail -t[/CODE] sendmail might be … | |
Re: Just so you know, they strongly discourage putting homework or work requests up oh this board. I don't run it; just thought you should know. That being said, all the other boards are dead, so : [CODE]#!/bin/ksh echo `uname -a` >>file.txt echo `hostname` >>file.txt echo $LOGNAME >>file.txt ls -d * … | |
Re: 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 | |
Re: 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 should echo the statement if you want to dump the out in a variable, since wc will … | |
Re: 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: [QUOTE]ps -ef | awk '/Cpu/ {if ($2 > 50 ) print "exceed"}'[/QUOTE] and assign it … | |
Re: Hey there, Sometimes it will work if you just replace your exec call with a simple direct call, so instead of: [QUOTE]exec $SHELL[/QUOTE] just do [QUOTE]$SHELL[/QUOTE] <-- Since you're not exec'ing (i.e. replacing the current process with your new process, you shouldn't get the session timeout error since you'll just … | |
Re: Hey there, This should work: [QUOTE]mkdir `date +%Y%m%d`[/QUOTE] Best wishes, Mike | |
Re: Hey There, Also, at the end of your code if you change: [CODE]echo "${name}:${phone}:${address}" >> addressbook.txt[/CODE] to [CODE]echo "${name}:${phone}:${address}" > addressbook.txt[/CODE] should inline replace the file. Hope that helps :) , Mike | |
Re: 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 incorrect. One thing I was thinking was that it might be easier to create the script to … | |
Re: 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: [QUOTE](echo 0;echo p;echo p)|format[/QUOTE] The partition print shows size in MB - You … | |
Re: 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 command you were feeding to the pipe. [CODE]while read j1 j2 j3 j4 fsize j5 j6 … | |
Re: Hey there, I'm sure what you're shooting for but, maybe: [CODE]LOG=${PROCS}.log $LOG "0"[/CODE] or [CODE]echo "0" >>$LOG[/CODE] Other than that, I'll need more specifics. Best wishes, Mike | |
Re: 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 your /dev/null) you could just run this in cron with one line and just "assume" the permissions have been changed. … | |
Re: 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 def's twice If you change the last line of your function to: [CODE]sed 's/\$//' $dataFile|awk 'BEGIN{FS=","; RS="\n"} … | |
Re: Hey there, Just a word of practical advice. If you really "need" a solution and don't have time to wait for someone else to take of their own time to help you with your problem, try doing a search on google for something like: [QUOTE]script to remove extension from filename[/QUOTE] … | |
Re: 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, just be careful that you don't use Mozilla as they're litigation happy (more details on the options … |