untested but should come close:
find ~/.loki -name '*.dso'|xargs rm
Assumption:
file is run under the user's id otherwise the ~ will not substitute
correctly.
Bret and Sean, thanks very much! Within the .loki directory are about 20
subdirectories with these .dso files. Will this command
On Wed, 2003-08-27 at 20:14, Bradley Caricofe wrote:
untested but should come close:
find ~/.loki -name '*.dso'|xargs rm
Assumption:
file is run under the user's id otherwise the ~ will not substitute
correctly.
Bret and Sean, thanks very much! Within the .loki directory are
I always found man find to be hard to glean usable information from but
info find does a pretty good job of explaining and gives some examples.
Thanks very much! Very, very helpful... =)
- Brad
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
On Wed, 27 Aug 2003 18:04:36 -0400
Bradley Caricofe [EMAIL PROTECTED] wrote:
I have a Tribes 2 server running on my RH 7.2 system and I have a simple
startup script that brings the game server up. The game creates a hidden
.loki folder in my users home directory which contains all of the game
On Wed, 2003-08-27 at 17:04, Bradley Caricofe wrote:
I have a Tribes 2 server running on my RH 7.2 system and I have a simple
startup script that brings the game server up. The game creates a hidden
.loki folder in my users home directory which contains all of the game
settings. Within this
Thanks!
Am Son, 2003-03-16 um 22.23 schrieb Robert P. J. Day:
...
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list
On Sun, 16 Mar 2003, Kleiner Hampel wrote:
Hi,
i have a directory with some files with spaces in the name:
abc 1.mp3
abc 2.mp3
abc 3 track 2.mp3
For my shell script i have to begin so:
for i in `ls`; do echo $i; done
Try
cd /tmp/foo
for i in * ; do echo $i ; done
You need the
Hi,
now it works, but because of the '*'.
now i want to remove the leading abc from all files in my directory.
i tried this:
for i in *; do mv $i `echo $i | sed s/abc//`; done
but it doesn't do that.
i always get the error, that the last arguement must be a directory!
I guess, the reason are
-Original Message-
From: Kleiner Hampel
Sent: Sunday, March 16, 2003 10:41 AM
Subject: Re: shell script - expert question
Hi,
now it works, but because of the '*'.
now i want to remove the leading abc from all files in my directory.
i tried this:
for i in *; do mv $i
On 16 Mar 2003, Kleiner Hampel wrote:
Hi,
now it works, but because of the '*'.
now i want to remove the leading abc from all files in my directory.
i tried this:
for i in *; do mv $i `echo $i | sed s/abc//`; done
but it doesn't do that.
i always get the error, that the last
On Sun, 16 Mar 2003, Cowles, Steve wrote:
-Original Message-
From: Kleiner Hampel
Sent: Sunday, March 16, 2003 10:41 AM
Subject: Re: shell script - expert question
Hi,
now it works, but because of the '*'.
now i want to remove the leading abc from all files in my
Thanks, this works!
regards,
hampel
Am Son, 2003-03-16 um 18.23 schrieb Mikkel L. Ellertson:
On 16 Mar 2003, Kleiner Hampel wrote:
Hi,
now it works, but because of the '*'.
now i want to remove the leading abc from all files in my directory.
i tried this:
for i in *; do mv
Mar 2003, Cowles, Steve wrote:
-Original Message-
From: Kleiner Hampel
Sent: Sunday, March 16, 2003 10:41 AM
Subject: Re: shell script - expert question
Hi,
now it works, but because of the '*'.
now i want to remove the leading abc from all files in my
Hi,
this results in the same error message!
regards,
hampel
Am Son, 2003-03-16 um 18.20 schrieb Cowles, Steve:
-Original Message-
From: Kleiner Hampel
Sent: Sunday, March 16, 2003 10:41 AM
Subject: Re: shell script - expert question
Hi,
now it works, but because
On 16 Mar 2003, Kleiner Hampel wrote:
Hi,
tricky!
But what is about:
${var##string}
${var%string}
${var%%string}
What means the double #, the single and double #?
Please explain me in some words! Thanks!
Is there a man page with this information?
these are internal *shell*
: Re: Shell Script Returned Value
Kevin - KD Micro Software wrote:
Hello everyone,
I have a small programming question here, which I'm not sure if it's
possible to do or not, but any suggestions would be greatly appreciated.
What I need is for the following to return with the appropriate
Kevin - KD Micro Software wrote:
Hello everyone,
I have a small programming question here, which I'm not sure if it's
possible to do or not, but any suggestions would be greatly appreciated.
What I need is for the following to return with the appropriate exit status
value ( $? ).
Start
Maybe the following will work:
( tar . ; TAR_RETVAL=$? ) | while read ...
the () puts the tar is a subshell, the subshell's output goes to your
loop.
Dan
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
On Behalf Of Kevin - KD Micro Software
Sent: Monday,
The other thing you could do is tee the output to a file, then process
that file. That would allow you to check return codes
and also process the filenames tar spews out. Would be two separate
steps and little more code! What you are doing is unusual and,
interesting! OK, exactly what are
There are several options but this one will work (Assuming bash or sh):
if [ $2 == ]; then
Also, here is a very handy guide I use for those quick lookups when you
get rusty. It is avail. in PDF and HTML.
http://personal.riverusers.com/~thegrendel/abs-guide-1.6.tar.bz2
-Chuck
MET wrote:
On Tue, Nov 05, 2002 at 06:46:29PM -0500, MET wrote:
Simply put, I'm trying to check if $2 is set. Any ideas?
if ( ! $2 ) then
echo You must set a second file
exit 1
fi
The above doesn't work reporting if expression error. Any help would be
On Tuesday 05 November 2002 06:54 pm, Hal Burgiss wrote:
On Tue, Nov 05, 2002 at 06:46:29PM -0500, MET wrote:
Simply put, I'm trying to check if $2 is set. Any ideas?
if ( ! $2 ) then
echo You must set a second file
exit 1
fi
The above doesn't work
On Tue, 5 Nov 2002, MET wrote:
if ( ! $2 ) then
echo You must set a second file
exit 1
fi
Start by reading the bash manual at:
http://www.gnu.org/manual/bash-2.05a/bashref.html
But you can do a test expression like:
if [[ -z $2 ]];
I've tried what follows and I still get if: Expression Syntax .
#!/bin/tcsh
if [ -z $2 ] ; then
echo You have not set a file to be appended.
exit 1
fi
Any ideas?
~ MET
On Tuesday 05 November 2002 7:35 pm, Todd A. Jacobs wrote:
-Original Message-
From: MET
Subject: Re: Shell Script Question || Check for set variable
I've tried what follows and I still get if: Expression Syntax .
#!/bin/tcsh
if [ -z $2 ] ; then
echo You have not set a file to be appended
Thanks a lot that worked =)
~ Matthew
-Original Message-
From: [EMAIL PROTECTED] [mailto:redhat-list-admin;redhat.com]
On Behalf Of Cowles, Steve
Sent: Tuesday, November 05, 2002 10:49 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Shell Script Question || Check for set variable
On Tue, 10 Sep 2002, Steven W. Orr wrote:
tty_type=$(tty)
if [[ ${tty_type%/*} = /dev/pts ]]
then
TERM=vt100
else
TERM=scoansi
fi
Note that this will not catch instances inside of an xterm, since xterms
are assigned on a pts and not a pty. You may also want to test $SHLVL to
need to assign the TERM variable depending on if user
is on console TERM=scoansi, but if it's on terminal
'pts/#' then TERM=vt100..
In .bash_profile I saw this.
if tty-type in 'tty[1,2,#]' ; then
TERM=scoansi
else
TERM=vt100
fi
Did you 'EXPORT TERM'?
AFAIK you need to do
On Tue, 10 Sep 2002, alexis Vasquez wrote:
=need to assign the TERM variable depending on if user
=is on console TERM=scoansi, but if it's on terminal
='pts/#' then TERM=vt100..
=In .bash_profile I saw this.
=
=if [ -f ~/.bashrc ]; then
=. ~/.bashrc
=fi
=
=so I did
=get the value for
On Sat, 27 Jul 2002, Anthony E. Greene wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED] wrote:
while i'm thinking about it, is there a way to get both
the real and effective user names/UIDs? in case someone
has sued to
Robert P. J. Day,
On Saturday July 27, 2002 05:17, you said something about:
On Sat, 27 Jul 2002, Anthony E. Greene wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED]
wrote:
while i'm thinking about it, is there a way
On Sat, 27 Jul 2002, Brian Ashe wrote:
But to answer your original question...
You could use the logname command to do a comparison like so...
sadly, logname under limbo also seems to be broken. sigh.
rday
Robert P. J. Day, RHCE, RHCI
Eno River Technologies, Chapel Hill NC
Unix, Linux
On Sat, 2002-07-27 at 11:15, Brian Ashe wrote:
Robert P. J. Day,
On Saturday July 27, 2002 05:17, you said something about:
On Sat, 27 Jul 2002, Anthony E. Greene wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED]
On Sat, 27 Jul 2002, Robert P. J. Day wrote:
id: cannot print only names or real IDs in default format ()
id -run id -ur
--
The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing potatoes.
-
use whoami or more specifically VarName=`whoami`
steve
-Original Message-
From: Matthew Melvin [mailto:[EMAIL PROTECTED]]
Sent: 26 July 2002 03:35
To: [EMAIL PROTECTED]
Subject: Re: Shell Script...more
On Thu, 25 Jul 2002 at 9:17pm (-0500), Jesse Angell wrote:
Hey,
I
On Fri, 26 Jul 2002, Robert P. J. Day wrote:
while i'm thinking about it, is there a way to get both
the real and effective user names/UIDs? in case someone
id -r
--
The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED] wrote:
while i'm thinking about it, is there a way to get both
the real and effective user names/UIDs? in case someone
has sued to root, is there a way to see the original
login name?
On Thu, 25 Jul 2002, Jesse Angell wrote:
I need to make a shell script to look in
/home/$user/palaceserver/palace/psdata/backup
and in that folder delete all the files that are 7 day's old..
Could someone help me out with this?
$ man tmpwatch
rday
That tmpwatch that Robert suggested worked great.. I'll stick with that.
- Original Message -
From: Randy Weidman [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 8:19 PM
Subject: Re: Shell Script
I think this will do what you need
find /home
On Fri, 21 Jun 2002, Jesse Angell wrote:
I couldn't get them to work I emailed asking more about it, never a reply..
I remember a post asking how you specify the input and output files, which
I answered. If you're referring to a different question I must have
missed it. Please repost your
sed '/VirtualHost/,/VirtualHost/d' /www/conf/httpd.conf
steve
-Original Message-
From: Jesse Angell [mailto:[EMAIL PROTECTED]]
Sent: 21 June 2002 02:49
To: [EMAIL PROTECTED]
Subject: Shell Script
Hello,
I need to write a shell script to do the following
edit the
On Thu, 20 Jun 2002, Jesse Angell wrote:
Hello,
I need to write a shell script to do the following
edit the /www/conf/httpd.conf file
and search for the
VirtualHost *
DocumentRoot /var/www/virtual/$user/html
Servername $user.palaceunlimited.com
ErrorLog
I couldn't get them to work I emailed asking more about it, never a reply..
- Original Message -
From: David Kramer [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Sent: Friday, June 21, 2002 4:29 PM
Subject: Re: Shell Script
On Thu, 20 Jun 2002, Jesse Angell wrote:
Hello
Learn Perl and Regular Expressions :) It's in the Programming Perl
book (aka the camel book).
Essentially, it would look like
#!/usr/bin/perl
###READ THE FILE###
open(THEFILE, httpd.conf);
undef $/; #This makes the following read read in the whole file instead
#of one line
Dangit!! Just after posting, I noticed that I got the substitution wrong.
THIS
$httpdconf =~
s!VirtualHost\s+\*\s+DocumentRoot\s+/var/www/virtual/$ARGV[1]/html.*?/virtualhost!!;
should be changed to THIS
$httpdconf =~
Date: Thu, 20 Jun 2002 20:48:31 -0500
From: Jesse Angell [EMAIL PROTECTED]
I need to write a shell script to do the following
edit the /www/conf/httpd.conf file
and search for the
VirtualHost *
DocumentRoot /var/www/virtual/$user/html
Servername $user.palaceunlimited.com
ErrorLog
]On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 6:20 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: shell script
On Tue, Nov 21, 2000 at 03:12:57PM +0800, Corisen wrote:
thank you. any recommendation on books or website for a newbie to start
shell scripting?
Can't
O'Reilly - Learning the Bash Shell
Addison Wesley - Linux Unix Shell Programming
- Original Message -
From: Corisen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 1:12 AM
Subject: Re: shell script
thank you. any recommendation on books
On Tue, 21 Nov 2000, Corisen wrote:
pls advise how i can pass the result of "/home/userabe" to "rm -f -r"
to delete the directory?
You don't want to do it this way. Use 'xargs userdel -r' instead, which
will remove both the account and the home directory for you.
Check the man pages for both
On Tue, Nov 21, 2000 at 03:12:57PM +0800, Corisen wrote:
thank you. any recommendation on books or website for a newbie to start
shell scripting?
Can't tell about shellscript, but have a look at this website
zeus.eed.usv.ro/misc/doc/prog/index.htm
I would also like to know if you find a
]
Sent: Tuesday, November 21, 2000 3:08 PM
Subject: Re: shell script
VARIABLE=`grep .`
Take care of the quotes.. its the one present before "1" on an English
keyboard
Cheers
Aravind S
Hi, one more question: how can i assign the result from grep or awk to a
On Sat, 18 Nov 2000, Luke C Gavel wrote:
Where can I subscribe to magazines that discuss shell scripts?
You can try Heiner's Shelldorado on the web, or join the bash mailing list
on Moongroup.Com's website.
--
Todd A. Jacobs
Senior Network Consultant
What is the output of /home/userabc like?
Does it contain sub-directories which u want to be removed?
give me a sample and i'll help you out.
Cheers,
Vineeta
Corisen wrote:
i'm writing a simple shell script to automate removal of directories.
i've managed to extract the user home
you can use xargs to pass the output to rm..I will be like
ldapsearch uid=userabc homedirectory | grep homedirectory | awk -F= '{print
$2;}| xargs rm -Rf
Cheers
Aravind S
Vineeta wrote:
What is the output of /home/userabc like?
Does it contain sub-directories which u want to be removed?
bc? the question is really how to pipe an
output from some program (like grep or awk) to be the input of "rm" command.
thanks.
- Original Message -
From: Vineeta [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 2:13 PM
Subject: Re: shell script
What is
Hi, one more question: how can i assign the result from grep or awk to a
variable in shell script? Thanks.
- Original Message -
From: Aravind Sadagopan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 2:36 PM
Subject: Re: shell script
you can use xargs to pass
Thanks for your guidance. The deletion script is finally working. Cheers :)
- Original Message -
From: Aravind Sadagopan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 2:36 PM
Subject: Re: shell script
you can use xargs to pass the output to rm..I
pan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 2:36 PM
Subject: Re: shell script
you can use xargs to pass the output to rm..I will be like
ldapsearch uid=userabc homedirectory | grep homedirectory | awk -F=
'{print
$2;}| xargs rm -Rf
Cheers
Aravind S
thank you. any recommendation on books or website for a newbie to start
shell scripting?
- Original Message -
From: Aravind Sadagopan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 21, 2000 3:08 PM
Subject: Re: shell script
VARIABLE=`grep .`
Take care
hi ,
i Am Not Sure , but as far as i know There Is No Magazine About Shell Scripts
You Can Find A Lot Of Examples In Unix Books ...
Jalal
From [EMAIL PROTECTED] Sat Nov 18 15:17:40 2000
Delivered-To: [EMAIL PROTECTED]
Date: Sat, 18 Nov 2000 07:57:58 -0400 (AST)
From: [EMAIL PROTECTED]
*** REPLY SEPARATOR ***
On 18/11/00 at 7:57 [EMAIL PROTECTED] wrote:
Hi,
Where can I subscribe to magazines that discuss shell scripts?
Maybe you mean online...I have not checked to see if all the links are
still live.
http://cres20.anu.edu.au/manuals/korn_scr.html
WOW. That's a lot of links. I'll check them out.
Thanks,
L.G.
On Sun, 19 Nov 2000, Greg Wright wrote:
*** REPLY SEPARATOR ***
On 18/11/00 at 7:57 [EMAIL PROTECTED] wrote:
Hi,
Where can I subscribe to magazines that discuss shell scripts?
Maybe you mean
There is, one of my instructors from a college flashed such a mag
in our faces. I never saw it since. :) Perhaps another student
grabbed it, never to return it. But thank you for making me
remember this; I'm now going to email him! hehehe.
On Sat, 18 Nov 2000, Jalal Hajiqolamali wrote:
hi
Luke C Gavel wrote:
Hi,
Where can I subscribe to magazines that discuss shell scripts?
Best Regards,
L.G.
Sysadm does some of this as well as a whole bunch more. Linux Journal
not too bad either. Neither are scripting only but ususlly a perl or
two:)
Bret
On Sun, 21 May 2000, James Vellenga wrote:
Hello all.
I currently run rh6.2 and it uses pump to establish dhcp
connections. I have a cable modem and pump does not work, however,
dhcpcd works great. Unfortunatally ifup and ifdown use pump now. I am
no good at writing shell scripts,
On Sun, 21 May 2000, James Vellenga wrote:
Hello all.
I currently run rh6.2 and it uses pump to establish dhcp
connections. I have a cable modem and pump does not work, however,
dhcpcd works great. Unfortunatally ifup and ifdown use pump now. I am
no good at writing shell scripts,
To: [EMAIL PROTECTED]
Subject: Re: shell script
Rodrigo Moya wrote:
I've got a text file containing the following:
/dir/file1=/mnt/zip/dir/file1
/dir/dir/file2=/mnt/zip/dir/dir/file1
...
and like this with hundreds of files. What I want is to read all the
file and copy the files in the first p
At 06:21 PM 3/13/00 +0100, Rodrigo Moya wrote:
Hi all!
I've got a text file containing the following:
/dir/file1=/mnt/zip/dir/file1
/dir/dir/file2=/mnt/zip/dir/dir/file1
...
and like this with hundreds of files. What I want is to read all the
file and copy the files in the first position (to
Rodrigo Moya wrote:
I've got a text file containing the following:
/dir/file1=/mnt/zip/dir/file1
/dir/dir/file2=/mnt/zip/dir/dir/file1
...
and like this with hundreds of files. What I want is to read all the
file and copy the files in the first position (to the left of '=') to
the
69 matches
Mail list logo