[expert] Bash Scripting

2000-06-10 Thread Necrotica
I'm interested in learning a little about bash scripting. In particular, I'd like to learn how to tell if the user logging on is logging in under X or from a command prompt. Can anyone point me in the direction of where I can find this information? Thanks... -Chris

Re: [expert] Bash Scripting

2000-06-10 Thread Civileme
Necrotica wrote: > > I'm interested in learning a little about bash scripting. In particular, I'd > like to learn how to tell if the user logging on is logging in under X or from > a command prompt. Can anyone point me in the direction of where I can find this > information? Thanks... > > -Chris

Re: [expert] Bash Scripting

2000-06-10 Thread Civileme
Civileme wrote: > > Necrotica wrote: > > > > I'm interested in learning a little about bash scripting. In particular, I'd > > like to learn how to tell if the user logging on is logging in under X or from > > a command prompt. Can anyone point me in the direction of where I can find this > > info

Re: [expert] Bash Scripting

2000-06-10 Thread Necrotica
Thanks for the help, guys. That was exactly what I was looking for! -Chris On Sat, 10 Jun 2000, Civileme wrote: > Civileme wrote: > > > > Necrotica wrote: > > > > > > I'm interested in learning a little about bash scripting. In particular, I'd > > > like to learn how to tell if the user loggin

Re: [expert] Bash Scripting

2000-06-10 Thread Brian T. Schellenberger
Necrotica wrote: > > I'm interested in learning a little about bash scripting. In particular, I'd > like to learn how to tell if the user logging on is logging in under X or from > a command prompt. Can anyone point me in the direction of where I can find this > information? Thanks... > > -Chris

[expert] bash scripting question - simple regular expression?

2003-01-11 Thread Jim C
I have a list of positive integers of which I only want the first one. They are of arbitrary size. How can I cut the rest of them off? I've been trying to write a regular expression for this using sed or awk. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.c

Re: [expert] bash scripting question - simple regular expression?

2003-01-11 Thread Mark Weaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Saturday 11 January 2003 08:56 pm, Jim C wrote: > I have a list of positive integers of which I only want the first one. > They are of arbitrary size. How can I cut the rest of them off? > I've been trying to write a regular expression for this usin

Re: [expert] bash scripting question - simple regular expression?

2003-01-11 Thread Bopolissimus Platypus
> On Saturday 11 January 2003 08:56 pm, Jim C wrote: > > I have a list of positive integers of which I only want the first one. > > They are of arbitrary size. How can I cut the rest of them off? > > I've been trying to write a regular expression for this using sed or awk. you don't specify the fo

Re: [expert] bash scripting question - simple regular expression?

2003-01-12 Thread Jim C
The are already sorted. I just need the largest one which is the first one. Mark Weaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Saturday 11 January 2003 08:56 pm, Jim C wrote: I have a list of positive integers of which I only want the first one. They are of arbitrary size. Ho

Re: [expert] bash scripting question - simple regular expression?

2003-01-12 Thread Jim C
On Saturday 11 January 2003 08:56 pm, Jim C wrote: I have a list of positive integers of which I only want the first one. They are of arbitrary size. How can I cut the rest of them off? I've been trying to write a regular expression for this using sed or awk. you don't specify the format of

Re: [expert] bash scripting question - simple regular expression?

2003-01-12 Thread Toshiro
> >>>I have a list of positive integers of which I only want the first one. > >>>They are of arbitrary size. How can I cut the rest of them off? > >>>I've been trying to write a regular expression for this using sed or > >>> awk. > > > > you don't specify the format of the integers. are they spac

Re: [expert] bash scripting question - simple regular expression?

2003-01-12 Thread Mark Alexander
On Sat, Jan 11, 2003 at 05:56:16PM -0800, Jim C wrote: > I have a list of positive integers of which I only want the first one. > They are of arbitrary size. How can I cut the rest of them off? > I've been trying to write a regular expression for this using sed or awk. #!/bin/sh LIST="42 666 1776

Re: [expert] bash scripting question - simple regular expression?

2003-01-12 Thread jipe
On Sat, 11 Jan 2003 17:56:16 -0800 Jim C <[EMAIL PROTECTED]> wrote: > I have a list of positive integers of which I only want the first one. > They are of arbitrary size. How can I cut the rest of them off? > I've been trying to write a regular expression for this using sed or awk. > > > bash

Re: [expert] bash scripting question - simple regular expression?

2003-01-12 Thread jipe
On Sun, 12 Jan 2003 09:15:50 -0800 Mark Alexander <[EMAIL PROTECTED]> wrote: > On Sat, Jan 11, 2003 at 05:56:16PM -0800, Jim C wrote: > > I have a list of positive integers of which I only want the first one. > > They are of arbitrary size. How can I cut the rest of them off? > > I've been trying

Re: [expert] bash scripting question - simple regular expression?

2003-01-13 Thread Jim C
Wow. I didn't know bash had arrays. Kool. :-) jipe wrote: On Sat, 11 Jan 2003 17:56:16 -0800 Jim C <[EMAIL PROTECTED]> wrote: I have a list of positive integers of which I only want the first one. They are of arbitrary size. How can I cut the rest of them off? I've been trying to write a reg

Re: [expert] bash scripting question - simple regular expression?

2003-01-13 Thread Jim C
Great but now I have another problem. What I am trying to do is create a sort of virtual file. I've already tried using the here document and it doesn't seem to be working for me. What I am trying to do exactly is create an LDIF file for passing to an LDAP database. I have each line stored in

Re: [expert] bash scripting question - simple regular expression?

2003-01-13 Thread Todd Lyons
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim C wrote on Mon, Jan 13, 2003 at 10:16:41AM -0800 : > > What I am trying to do is create a sort of virtual file. > I've already tried using the here document and it doesn't seem to be > working for me. What I am trying to do exactly is create an

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread Jim C
I finally got around to giving your suggestion a try. :-) cat > $newldif < dn: uid=$1,ou=Computers,dc=microverse,dc=net objectClass: top objectClass: account objectClass: posixAccount uidNumber: $store uid: $1 cn: $1 gidNumber: $groupnum homeDirectory: /dev/null loginShell: /bin/false gecos: Machi

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread Jim C
Grrr!! What gets me is why this doesn't work: echo -e $output > ldapadd -x -D $binddn -W $pw4binddn where echo -e produces: [root@enigma scripts]# ./adduser alkjdfal dn: uid=alkjdfal,ou=Computers,dc=microverse,dc=net objectClass: top objectClass: account objectClass: posixAccount uidNumber: 5

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread jipe
On Tue, 14 Jan 2003 12:58:30 -0800 Jim C <[EMAIL PROTECTED]> wrote: > Grrr!! > > What gets me is why this doesn't work: > > echo -e $output > ldapadd -x -D $binddn -W $pw4binddn > > where echo -e produces: > > [root@enigma scripts]# ./adduser alkjdfal > > dn: uid=alkjdfal,ou=Computers,dc=mic

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread Todd Lyons
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim C wrote on Tue, Jan 14, 2003 at 11:31:20AM -0800 : > I finally got around to giving your suggestion a try. :-) > > cat > $newldif < dn: uid=$1,ou=Computers,dc=microverse,dc=net > objectClass: top > objectClass: account > objectClass: posixAccount

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread Jim C
jipe wrote: here is what says man: The entry information is read from standard input or from file through the use of the -f option. so why not to try this: echo -e "$output" | ldapadd -x -D "cn=root,dc=microverse,dc=net" This produces an error, i.e. I get the usage text for ldapadd if I tr

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread Jim C
echo $newldif This produces: [root@enigma scripts]# ./adduser adlfalj ./adduser: line 42: $newldif: ambiguous redirect You've got something else going on cause it works on mine. (Are you sure that you're using the bash shell?) [root@enigma scripts]# echo $SHELL /bin/bash [root@enigma scripts]

Re: [expert] bash scripting question - simple regular expression?

2003-01-14 Thread Jim C
Herein lies part of the problem. I don't want to use a file for scaleability reasons and I can't think of any reason why it should be nescesary. In theory I should be able to store all of the text in a shell variable and then redirect the output of echo to ldapadd. So far I can get the text in

Re: [expert] bash scripting question - simple regular expression?

2003-01-15 Thread Todd Lyons
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim C wrote on Tue, Jan 14, 2003 at 07:28:07PM -0800 : > >newldif="./file2" > Herein lies part of the problem. > I don't want to use a file for scaleability reasons and I can't think of > any reason why it should be nescesary. In theory I should be