• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Linux people, please help me with my shell commands

Just type all the commands into a text file, one command per line - call the file anything you want, say "script.x". Then do "chmod +x script.x". Then you can just do "./script.x" and it will run the commands, one after another.
 
Another good question is why aren't you just using the awstats package provided by your distro?

But if you really want to use that and make it a script just put those into a file.sh, put "#!/bin/bash" at the top without the quotes and type 'chmod +x file.sh' to make it executable.
 
You can eliminate all your cd lines by using absolute paths.
For wget, I think you can control the target directory with -P or --directory-prefix

That'll trim a few lines; but won't actually save you any typing.
As Heinsenburg suggests, this is a classic scripting situation.
 
the prob is that i am running this on like 500 server, i shell into each one and just type the commands, awstats that i am running is 6.3, easy to exploit
 
the prob is that i am running this on like 500 server, i shell into each one and just type the commands, awstats that i am running is 6.3, easy to exploit

A better idea would be to write a script that does the ssh commands for you, if you have pub/priv key auth setup you won't even have to login.

Still begs the question as to why you're not running the awstats package that comes with your distro, they should have released an update that would take care of this and you could just upgrade that like normal.
 
well as it is, the VPSs here are setup with 6.3 and fedora core 2, they just havent changed, plus there is like 500 accounts that have already been installed with the old awstats
 
Originally posted by: TheSiege
so anyone want to help me with this

Like I tell all Linux peeps don't try to learn Linux on a Fourm. Use Freenode IRC ---> http://freenode.net/

Go to irc.freenode.net if you use Xchat it's listed as one of the servers, then join the channel of your distro, REALTIME 24/7 chat for the world of Opensource. 😉

If you don't run X windows then install and use irssi -----> http://www.irssi.org/

Irssi is a terminal based IRC client, easier to use then BitchX.

X Windows or Console, either way you can chat! 😉

ALOHA
 
so anyone want to help me with this

We did, what you have there will work as-is in a shell script and I mentioned how you could make it a little easier on yourself with pub/priv key authentication via ssh.
 
Or if you don't like it all on one line, you can copy and past this, just copy the entire thing at once, line breaks and everything:

edit: dang it "attach code" took out the line breaks. Here:

cd /tmp/ && wget http://umn.dl.sourcefor
ge.net/sourceforge/awstats/awstats-6.5.t
ar.gz && tar zxvf awstats-6.5.tar.gz &&
rm -Rf /var/www/cgi-bin/awstats && cd /t
mp/awstats-6.5/wwwroot/ && mv cgi-bin aw
stats && cp -Rpf awstats/ /var/www/cgi-b
in/ && cd /tmp && rm -f awstats-6.5.tar.
gz && rm -rf awstats-6.5/

edit: freaking heck. Fusetalk took out the backslashes. Ok, take my first line of code and put a backslash at then end of each line you want to break off into a new line (you can even do it in the middle of a command or wherever. But really this is just to make it look pretty. It will work just like the first line of command I posted above.
 
Back
Top