If you don't mind specifying your reference file on the command line as a
shell script parameter, you can use $1 inside the shell script to pick its
name up and do things with it.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTE
SENTHIL KUMAR wrote:
Hi,
i plan to run a program over some 20 files were i need to input
one files as REFERENCE and then the remaining as TEST. i have return
a script to take every file in the list to be taken a REF and the
remaining as TEST and it works well{all with all }. but i want t
Hi,
i plan to run a program over some 20 files were i need to input
one files as REFERENCE and then the remaining as TEST. i have return
a script to take every file in the list to be taken a REF and the
remaining as TEST and it works well{all with all }. but i want to
specify which one to
Is it just more efficient in resources to use plain #! /bin/sh
rather than bash?
No, it just makes your script more portable to systems that might not
have bash.
Some systems that /do/ have bash installed have /bin/sh linked to it,
but some don't have bash by default or choice (Solaris, Fre
martin f krafft <[EMAIL PROTECTED]> said on Fri, 21 May 2004 01:39:55 +0200:
>
> --ikeVEW9yuYc//A+q
> Content-Type: text/plain; charset=iso-8859-15
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> also sprach Martin McCormick <[EMAIL PROTECTED]> [2004.05.20.2126 +=
also sprach Martin McCormick <[EMAIL PROTECTED]> [2004.05.20.2126 +0200]:
> Is it just more efficient in resources to use plain #! /bin/sh
> rather than bash?
surely not. /bin/sh is generally linked to bash (... by default,
that is).
--
Please do not CC me when replying to lists; I read th
A response to another poster peaked my curiosity.
> Incidentally, there is no reason to make it a bash
> script rather than vanilla sh, and you can simplify the script by using
> exec:
I have been writing shell scripts for a bit over fourteen
years so I am not new to this, but I u
On Wed, May 19, 2004 at 08:11:35AM -0500, Michael Martinell wrote:
} Hopefully somebody here has perhaps seen this oddity and can provide some
} insight into the cause.
}
} I have a very simple shell script as follows:
} mail:~/scripts# more topcheck
} #!/bin/bash
} date > /usr/local/apache/htdocs
Hopefully somebody here has perhaps seen this oddity and can provide some
insight into the cause.
I have a very simple shell script as follows:
mail:~/scripts# more topcheck
#!/bin/bash
date > /usr/local/apache/htdocs/topout.txt
echo "\c" ; top -n 1 >> /usr/local/apache/htdocs/topout.txt
I have a
Pete Clarke declaimed:
> > The core loop is clearly
> >
> > > for file in "$1"
> > > do
> > > filename=${file%.*}
> > > echo "Adding $file to $filename.zip..."
> > > $ZIP $ARGS "$filename" "$file" > /dev/null
> > >
> > > let "nofiles += 1"
Hi Pete,
> I have a script that performs batch zipping of files. Trouble is that it
> only does one file at a time (kind of going against the "batch" idea).
> Could someone point out the silly mistake I am obviously making?
[...]
> #!/bin/sh
> #
> # batch zip
> # invoke with batchzip
> #
> # th
you can save the script as batchzip.sh
then make it an executable..
>chmod 755 batchzip.sh
and then run it
>./batchzip.sh
HTH,
Pritpal Dhaliwal
[EMAIL PROTECTED] wrote:
How do you call your script?
Aurel
Quoting Pete Clarke <[EMAIL PROTECTED]>:
Hi there people,
I have a script that performs
How do you call your script?
Aurel
Quoting Pete Clarke <[EMAIL PROTECTED]>:
> Hi there people,
>
> I have a script that performs batch zipping of files. Trouble is that it
> only does one file at a time (kind of going against the "batch" idea).
> Could someone point out the silly mistake I am
se stow to put it into /usr/local.
> 2. If i would want to use extra modules, i suppose i should
> compile them too and make packages of it?
Dunno much about php, but I guess so.
> 3. Has anybody else used php for shell scripting purposes?
> Any sites with shell scripts? I've see
kage from it?
Is this the debian specific way when you want a package
that isn't available yet?
2. If i would want to use extra modules, i suppose i should
compile them too and make packages of it?
3. Has anybody else used php for shell scripting purposes?
Any sites with shell scripts? I'
On Mon, Oct 07, 2002 at 07:03:25PM -0400, Matt Price wrote:
> But re: the here script:
They're actually usually called "here documents" or "heredocs".
> does this work if I write it ina simple shell script?
Yes.
> That is do I write a script thus:
> cd ~!/website
That ! looks odd ... did you
Michael,
thanks for the ref to ncftpput. I'l\l look into that and lftp, as
someone else suggested. But re: the here script: does this work if I
write it ina simple shell script? That is do I write a script thus:
cd ~!/website
ftp -i origin.chass.utoronto.ca< On Mon, Oct 07, 2002 at 05:44:53PM
On Mon, Oct 07, 2002 at 05:44:53PM -0400, Matt Price wrote:
> command line, far as I can tell. so: is there a way to pass these
> instructions on to ftp from a shell script? I imagine this must be a
The first thing I'd suggest is using one of the script-oriented FTP
tools that was designed to w
Hi,
* Matt Price <[EMAIL PROTECTED]> [02-10-07 23:44]:
>I have a webstie which I manage both from home (mac) and work
>(woody). I use sitecopy at work but my access is only via ftp, so
>sitecopy can't identify newer files on the website. So after I
>upsdate the site form home, I usually log in
hi everyone,
just trying to learn how to do shell scription, assigned myself a
simple task:
I have a webstie which I manage both from home (mac) and work
(woody). I use sitecopy at work but my access is only via ftp, so
sitecopy can't identify newer files on the website. So after I
upsdate the
Craig Dickson wrote:
> john wrote:
>
> > Sunny Dubey wrote:
> >
> > > Hey,
> > >
> > > how come the followind doesn't seem to work ...
> > >
> > > for i in `ls -1 /some/dir` ; do
> > > cat /some/dir/"$i" >> /usr/fruits.txt
> > > done
> > >
> >
> > because $i contains lines like:
> > dr
john wrote:
> Sunny Dubey wrote:
>
> > Hey,
> >
> > how come the followind doesn't seem to work ...
> >
> > for i in `ls -1 /some/dir` ; do
> > cat /some/dir/"$i" >> /usr/fruits.txt
> > done
> >
>
> because $i contains lines like:
> drw-r--r--2 sunnysunny12345 Oct 23
Sunny Dubey wrote:
> how come the followind doesn't seem to work ...
>
> for i in `ls -1 /some/dir` ; do
> cat /some/dir/"$i" >> /usr/fruits.txt
> done
>
> cat just gives me the odd error of files not being found, however, I can't
> see why the files wouldn't be found ... hrrm ...
>
> th
Apparently, on Mon, Nov 05, 2001 at 09:04:38PM -0500, Sunny Dubey wrote:
> Hey,
>
> how come the followind doesn't seem to work ...
>
>
> for i in `ls -1 /some/dir` ; do
> cat /some/dir/"$i" >> /usr/fruits.txt
> done
>
> cat just gives me the odd error of files not being found, however, I
--- Sunny Dubey <[EMAIL PROTECTED]> wrote: > Hey,
>
> how come the followind doesn't seem to work ...
>
>
> for i in `ls -1 /some/dir` ; do
> cat /some/dir/"$i" >> /usr/fruits.txt
> done
the problem is with -l switch
>
> cat just gives me the odd error of files not being
> found,
Hi Sunny!
Sunny Dubey wrote:
> Hey,
>
> how come the followind doesn't seem to work ...
>
> for i in `ls -1 /some/dir` ; do
> cat /some/dir/"$i" >> /usr/fruits.txt
> done
>
because $i contains lines like:
drw-r--r--2 sunnysunny12345 Oct 23 14:09 hello.c
which is very
6:04 PM
Subject: Shell Scripting Question
> Hey,
>
> how come the followind doesn't seem to work ...
>
>
> for i in `ls -1 /some/dir` ; do
> cat /some/dir/"$i" >> /usr/fruits.txt
> done
>
> cat just gives me the odd error of files not being fou
Hey,
how come the followind doesn't seem to work ...
for i in `ls -1 /some/dir` ; do
cat /some/dir/"$i" >> /usr/fruits.txt
done
cat just gives me the odd error of files not being found, however, I can't
see why the files wouldn't be found ... hrrm ...
thanks much for any info you migh
> Use another loop:
>
> for $fruit in `cat fruits`; do
> while [ -z $ANS ]; do
> echo -n "Do you like $fruit"
> read ANS
> done
> done
hey, thanks for the code above :)
It works, I just needed to add a unset ANS above the while [ blah blah ] line
thanks
S
On Tue, Oct 30, 2001 at 06:48:42PM -0500, Sunny Dubey wrote:
> for $fruit in `cat /usr/fruits.txt` ;
> do
> echo -n "Do you like $fruit"
> read ANS
> if [ -z $ANS ] ; then
> # NEED HELP WITH CODE HERE
> fi
> done
>
On Tue, Oct 30, 2001 at 06:48:42PM -0500, Sunny Dubey wrote:
> for $fruit in `cat /usr/fruits.txt` ;
> do
> echo -n "Do you like $fruit"
> read ANS
> if [ -z $ANS ] ; then
> # NEED HELP WITH CODE HERE
> fi
> done
>
hey,
Say i'm doing a loop in which I ask someone a question ...
for $fruit in `cat /usr/fruits.txt` ;
do
echo -n "Do you like $fruit"
read ANS
if [ -z $ANS ] ; then
# NEED HELP WITH CODE HERE
fi
done
On Sat, Oct 27, 2001 at 06:10:35PM -0400, Sunny Dubey wrote:
> my question is, how do I get it to print the list with each line as the
> variable $fruit, as opposed to $fruit being each word.
Set the IFS variable to exclude spaces. (Normally it contains a space, a
tab, and a newline.) $IFS contro
Hi, (I am not programmer)
On Sat, Oct 27, 2001 at 06:10:35PM -0400, Sunny Dubey wrote:
> I have a file which as a list of varions itmes (example below)
>
> # /usr/food/fruits.txt
> banana medium yellow
> apple small red
> watermelon big green
> plum small red
> etc etc etc ...
>
> when I create
Hello,
I believe something like this should work:
for $fruit in 'cat /usr/food/fruits.txt' &&
do echo -n $fruit
done
echo -n omits the trailing newline as seen in 'man echo'
Enjoy,
Cameron Matheson
On Sat, Oct 27, 2001 at 06:10:35PM -0400, Sunny Dubey wrote:
> I have a file which as a
on Sat, Oct 27, 2001 at 06:10:35PM -0400, Sunny Dubey ([EMAIL PROTECTED]) wrote:
> (sorry if this got send to the list twice)
>
> Hi,
>
> I have a file which as a list of varions itmes (example below)
>
> # /usr/food/fruits.txt
> banana medium yellow
> apple small red
> watermelon big green
> pl
(sorry if this got send to the list twice)
Hi,
I have a file which as a list of varions itmes (example below)
# /usr/food/fruits.txt
banana medium yellow
apple small red
watermelon big green
plum small red
etc etc etc ...
when I create the following loop ...
for $fruit in `cat /usr/food/fruits
* David Wiard <[EMAIL PROTECTED]> writes:
> Could someone point me in a good direction to start learning some shell
> scripting? I can do the extreme basic stuff, but I'd like to learn a lot
O'Reilly's Debian book has a chapter about bash. Here is the online ver
To: debian-user@lists.debian.org
> Subject: [OFF-TOPIC] shell scripting
>
> Could someone point me in a good direction to start learning some shell
> scripting? I can do the extreme basic stuff, but I'd like to learn a lot
> more than I already know. Any references for learning
>Could someone point me in a good direction to start learning some shell
>scripting? I can do the extreme basic stuff, but I'd like to learn a lot
>more than I already know. Any references for learning perl? shell scripting
>in general?
Shell Scripting - for starters look a
> Could someone point me in a good direction to start learning some shell
> scripting? I can do the extreme basic stuff, but I'd like to learn a lot
> more than I already know. Any references for learning perl? shell scripting
> in general?
>
If you like bash, then get &quo
Could someone point me in a good direction to start learning some shell
scripting? I can do the extreme basic stuff, but I'd like to learn a lot
more than I already know. Any references for learning perl? shell scripting
in general?
TIA
--
dave wiard ([EMAIL PROTECTED])
The light that
> Hello al I was wondering if someone can tell me of some website taht
> talk aboput shell scripting in great detail thanks
>
Yeah, try www.perl.com
Oh, I just crack myself up...
I learned to do shell scripting using a copy of "Unix in a Nutshell", but I
think there's
On Thu, Apr 01, 1999 at 03:46:27PM -0600, Craig Hancock wrote:
> Hello al I was wondering if someone can tell me of some website taht
> talk aboput shell scripting in great detail thanks
The definitive reference for bash can be found (among other places)
at: http://www.gnu.org/manual/bas
Hello al I was wondering if someone can tell me of some website taht
talk aboput shell scripting in great detail thanks
> in dos, that "addmailuser" file will simply contain "adduser --conf
> /etc/mailuser.conf %1" where %1 is the first parameter that it sees, that
> is, the name of the user i want to add ... but how do u do this in linux ???
$1 is the first parm with bash. For simple scripts, see the files i
> I want to write a little shell script called "addmailuser" w/c
> executes "adduser --conf /etc/mailuser.conf" where mailuser.conf
> contains info like making their default shell /bin/false. in dos,
> that "addmailuser" file will simply contain "adduser --conf
> /etc/mailuser.conf %1" where %1 i
i want to write a little shell script called "addmailuser" w/c executes
"adduser --conf /etc/mailuser.conf" where mailuser.conf contains info like
making their default shell /bin/false.
in dos, that "addmailuser" file will simply contain "adduser --conf
/etc/mailuser.conf %1" where %1 is the
48 matches
Mail list logo