159 Posted Topics
Re: 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 prompt into a function: [icode] prompt () { echo "Please enter a file … | |
Re: 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 case, you can do something like this: [code] #!/bin/sh # First … | |
Re: Usually we use the "mv" (move) command to rename a file. Try something like this! [code] #!/bin/sh for FILE in $(find . -type f -name '*4%3a*'); do NEWNAME=$(echo $FILE|sed s/'4%3a'//) mv -v $FILE $NEWNAME done [/code] If the files are all in one directory, you can run this from in … | |
Re: Try this! [icode] ps -C bash -o pid=,size | awk '{SUM += $2} END {print SUM}' [/icode] The problem is that your awk statement doesn't have a "print" command. You have to tell it what to print. I also took some liberties in my example, and used some built in … | |
Re: Hi k2k, There are a few options. Usually, if you're the root user, these things are in your "PATH". Are you by any chance logging in as another user, and using the "su" command to get to root? if so, try using "su -l". This will start a login shell, … | |
Re: Okay, so this seems to be from 11 days ago. Have you gotten it resolved yet? I've seen this happen on AIX (I think it was) and it turned out to be a problem with a library that needed to be updated. May I ask why you're using compress rather … | |
Re: Here's another problem: "however, the dyndns.com auto detector detects another ip, i have to manually change it to 192.168.1.5 so i can do ssh at home" dyndns is detecting your "public" ip address, which is the one that you would use to connect to your home network from the internet … | |
Re: 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 translate to what you're doing because I don't know java, but I usually get … | |
Re: There are thousands of ways to do this one :) Try this! [icode] grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /var/lib/output [/icode] Thanks! -G |
The End.