I just find out:
#!/usr/local/bin/bash
export IFS=
cuc=$*
mkdir cuc
Thanks anyway!
László
From: Dánielisz László laszlo_daniel...@yahoo.com
To: freebsd-questions@freebsd.org
Sent: Tue, December 1, 2009 8:37:04 PM
Subject: bash script question
Hello,
I'd
Hello,
I'd like to ask how can I read a variable in the same line when I launch a
script?
For example ./script.sh directory_name, and I want the script to creat the
directory called directory_name or whatever I input there.
Thank you!
László
___
On Tue, 1 Dec 2009 11:48:43 -0800 (PST), Dánielisz László
laszlo_daniel...@yahoo.com wrote:
I just find out:
#!/usr/local/bin/bash
export IFS=
cuc=$*
mkdir cuc
The $* variable will expand to all arguments given on the
command line, e. g.
$ ./myscript foo bar baz
will result in
script question
Hello,
I'd like to ask how can I read a variable in the same line when I launch a
script?
For example ./script.sh directory_name, and I want the script to creat the directory
called directory_name or whatever I input there.
Thank you!
László
On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen laz...@lazlarlyricon.com
wrote:
Why are you using bash? To make a shell script as portable as possible,
use /bin/sh. Bash is a third party shell, that isn't included in a base
installation (you're not using bash as root's shell, are you?).
On Tue, Dec 01, 2009 at 10:42:10PM +0100, Polytropon wrote:
On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen laz...@lazlarlyricon.com
wrote:
Why are you using bash? To make a shell script as portable as possible,
use /bin/sh. Bash is a third party shell, that isn't included in a base
Gary Kline wrote:
On Tue, Dec 01, 2009 at 10:42:10PM +0100, Polytropon wrote:
On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen laz...@lazlarlyricon.com
wrote:
Why are you using bash? To make a shell script as portable as possible,
use /bin/sh. Bash is a third party shell, that isn't
On Tue, 1 Dec 2009 13:45:55 -0800, Gary Kline kl...@thought.org wrote:
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash script?
csh and (ba)sh use dufferent syntax and variable
On Tue, Dec 01, 2009 at 11:02:07PM +0100, Rolf G Nielsen wrote:
Gary Kline wrote:
On Tue, Dec 01, 2009 at 10:42:10PM +0100, Polytropon wrote:
On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen
laz...@lazlarlyricon.com wrote:
Why are you using bash? To make a shell script as portable as
On Tue, Dec 01, 2009 at 11:10:33PM +0100, Polytropon wrote:
On Tue, 1 Dec 2009 13:45:55 -0800, Gary Kline kl...@thought.org wrote:
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash
On 1/31/07, kris [EMAIL PROTECTED] wrote:
On Wed, Jan 31, 2007 at 02:27:24PM -0500, Dak Ghatikachalam wrote:
Thanks a lot , I test ran it. This is great
No problem. I should add that if this is to be part of a long running
script, you should close the co-process (the while-loop running cat),
On 1/31/07, kris [EMAIL PROTECTED] wrote:
On Wed, Jan 31, 2007 at 02:27:24PM -0500, Dak Ghatikachalam wrote:
Thanks a lot , I test ran it. This is great
No problem. I should add that if this is to be part of a long running
script, you should close the co-process (the while-loop running cat),
On Fri, Feb 02, 2007 at 11:10:02AM -0500, Dak Ghatikachalam wrote:
{ while cat /tmp/availspace.$$; do false; done } |
exec 5p
cat /tmp/reprocesses.$$|awk '/DATAFILE/ { print $0 }'|tr -d ' '|
while read file_b
do
read -u5 file_a
echo $file_b $file_a
done /tmp/reprocessrecset.$$
On 2/2/07, Kris Maglione [EMAIL PROTECTED] wrote:
On Fri, Feb 02, 2007 at 11:10:02AM -0500, Dak Ghatikachalam wrote:
{ while cat /tmp/availspace.$$; do false; done } |
exec 5p
cat /tmp/reprocesses.$$|awk '/DATAFILE/ { print $0 }'|tr -d ' '|
while read file_b
do
read -u5 file_a
Dear Freebsd'ers
I have a an issue to address.
in Korn Shell
I have file_1 containing
1
2
3
4
and I have another file_2 containing
A
B
C
D
E
F
G
H
I
I have use these file_1 and file_2 and generate a file file_3 containing.
A 1
B 2
C 3
D 4
E 1
F 2
G 3
H 4
I 1
I tried with several
On Wed, Jan 31, 2007 at 01:43:28PM -0500, Dak Ghatikachalam wrote:
I tried with several looping for some reason I dont seem to get in right in
Korn shell
Any ideas on Ksh would be great, You can use any standard unix utilities to
achieve this.
Something to this effect should suffice, though
On 1/31/07, Kris Maglione [EMAIL PROTECTED] wrote:
On Wed, Jan 31, 2007 at 01:43:28PM -0500, Dak Ghatikachalam wrote:
I tried with several looping for some reason I dont seem to get in right
in
Korn shell
Any ideas on Ksh would be great, You can use any standard unix utilities
to
achieve
On Wed, Jan 31, 2007 at 02:27:24PM -0500, Dak Ghatikachalam wrote:
Thanks a lot , I test ran it. This is great
No problem. I should add that if this is to be part of a long running
script, you should close the co-process (the while-loop running cat),
with something like:
exec 5p
exec 5-
Here I come with another easy one for most on the list -- except for me.
I have 12,000 plus lines that have an empty line in between each real line,
like so:
this is a line of info 1
(empty)
this is a line of info 2
this is a line of info 3
etc, etc
To eliminate each empty line in between
Hmm
sed -e /^$/d FILENAME newfilename
will do the job if they are empty lines.
Vince
Jack Stone wrote:
Here I come with another easy one for most on the list -- except for me.
I have 12,000 plus lines that have an empty line in between each real
line, like so:
this is a line of info 1
On Wed 15 Nov 09:17, Jack Stone wrote:
Here I come with another easy one for most on the list -- except for me.
I have 12,000 plus lines that have an empty line in between each real line,
like so:
[...]
grep -v '^$'
Cheers,
Nick.
--
With sufficient thrust, pigs fly just fine.
I have a spare 6.0 computer on which I ran the gnome_upgrade script.
My g** .. 47 ports were deleted amongst which are very big ones like
mozilla and all of KDE. This will take me a very long time to rebuild.
And this only because glib2 is changed?
I don't like this at all. It's a brandnew 6.0
On Monday 14 November 2005 12:20 pm, dick hoogendijk wrote:
I have a spare 6.0 computer on which I ran the gnome_upgrade script.
My g** .. 47 ports were deleted amongst which are very big ones like
mozilla and all of KDE. This will take me a very long time to
rebuild. And this only because
I'm working on a shell script to use p0f to identify unauthorized hosts
on our network.
In the script I use an echo command to see what the output of the command
is. This is what it looks like:
/usr/local/bin/p0f -i xl0 -N -l -o /root/capture.1123177152.log 'src net
10.0.0.0/8 or src net
--On Thursday, August 04, 2005 12:46:20 -0500 Paul Schmehl
[EMAIL PROTECTED] wrote:
I'm working on a shell script to use p0f to identify unauthorized hosts
on our network.
In the script I use an echo command to see what the output of the command
is. This is what it looks like:
Hi,
I am trying to run one of my installation shell script using the
command-
bash resetapp.sh
it gives me the error as-
'bash: not found'
How do I install bash? I am using FreeBSD/i3b6 5.2.1
Also, whats the command to check which version of FreeBSD I am using?
Please help me out,
Thanks a
Hi,
simply go to /usr/ports/shells/bash2 and type make install
uname -a will give you the version infos needed.
regards
Digish Reshamwala wrote:
Hi,
I am trying to run one of my installation shell script using the command-
bash resetapp.sh
it gives me the error as-
'bash: not found'
How do I
Digish Reshamwala wrote:
Hi,
Hi.
How do I install bash? I am using FreeBSD/i3b6 5.2.1
There are several ways to install software. The handbook deals with them
quite extensively:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html
'man pkg_add' might also be of help.
If your
On Thu, Feb 17, 2005 at 01:13:49PM -0800, Digish Reshamwala wrote:
Hi,
I am trying to run one of my installation shell script using the
command-
bash resetapp.sh
it gives me the error as-
'bash: not found'
How do I install bash? I am using FreeBSD/i3b6 5.2.1
pkg_add -r bash
On Feb 17, 2005, at 3:13 PM, Digish Reshamwala wrote:
Hi,
I am trying to run one of my installation shell script using the
command-
bash resetapp.sh
it gives me the error as-
'bash: not found'
How do I install bash? I am using FreeBSD/i3b6 5.2.1
Also, whats the command to check which version
On Thursday 17 February 2005 01:13 pm, Digish Reshamwala wrote:
Hi,
I am trying to run one of my installation shell script using the
command-
bash resetapp.sh
it gives me the error as-
'bash: not found'
How do I install bash? I am using FreeBSD/i3b6 5.2.1
Bash is in ports, try
On Sat, Jan 10, 2004 at 11:02:18PM +, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote:
On Sat, Jan 10, 2004 at 10:33:08PM +, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote:
Folks,
Hi list, I've making a script to write the content of three text files to
one file, but I want to separate each files by a delimiter like the name of
the file.
This is the script:
#! /bin/sh
path=/some/dir
if !([ -f $path/this.one ]); then
for file in $path/file1 $path/file2 $path/file3; do
Hi list, I've making a script to write the content of three text files
to one file, but I want to separate each files by a delimiter like the
name of the file.
Maybe this little sh(1) script can do the job:
# = begin.script =
#! /bin/sh
On Monday 12 January 2004 05:04 pm, Xpression wrote:
Hi list, I've making a script to write the content of three text files to
one file, but I want to separate each files by a delimiter like the name of
the file.
This is the script:
#! /bin/sh
path=/some/dir
if !([ -f $path/this.one ]);
On Jan 12, 2004, at 6:04 PM, Xpression wrote:
[ ...a question on how to change a shell script... ]
Try:
#! /bin/sh
path=/some/dir
if !([ -f $path/this.one ]); then
touch $path/this.one
for file in $path/file1 $path/file2 $path/file3; do
echo
Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 06:26:30PM -0500, Marty Landman wrote:
At 06:02 PM 1/10/2004, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Bj?rn Andersson wrote:
If this occures more than once on a line we should have the line as this:
perl -pi.bak
On Sat, Jan 10, 2004 at 05:34:34PM -0800, Gary Kline wrote:
On Sat, Jan 10, 2004 at 11:02:18PM +, Matthew Seaman wrote:
perl -pi.bak -e 's/\s*\w+_\w+\.?//g;' filename
The lines do indeed wrap so this does the job on a test file.
I do have the re-exp book but this one is
On Sun, Jan 11, 2004 at 11:52:37AM +, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 05:34:34PM -0800, Gary Kline wrote:
On Sat, Jan 10, 2004 at 11:02:18PM +, Matthew Seaman wrote:
perl -pi.bak -e 's/\s*\w+_\w+\.?//g;' filename
The lines do indeed wrap so this does the
Folks,
Let's see if perl can do this one; it's as obscure a task
as I've run into. I have scores of files with:
A regular sentence, or phrase. then_one_containing_underscores_-
between_each_word Followed by another regular, space-delimited
Gary Kline wrote:
Folks,
Let's see if perl can do this one; it's as obscure a task
as I've run into. I have scores of files with:
A regular sentence, or phrase. then_one_containing_underscores_-
between_each_word Followed by another regular,
On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote:
Folks,
Let's see if perl can do this one; it's as obscure a task
as I've run into. I have scores of files with:
A regular sentence, or phrase. then_one_containing_underscores_-
between_each_word
If this occures more than once on a line we should have the line as this:
perl -pi.bak -e 's/\s+\w+_\w+\.?//g;' filename
Notice the added g. :-)
On Sat, Jan 10, 2004 at 10:33:08PM +, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote:
Folks,
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote:
On Sat, Jan 10, 2004 at 10:33:08PM +, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 02:10:36PM -0800, Gary Kline wrote:
Folks,
Let's see if perl can do this one; it's as obscure a task
as I've run into. I
At 06:02 PM 1/10/2004, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote:
If this occures more than once on a line we should have the line as this:
perl -pi.bak -e 's/\s+\w+_\w+\.?//g;' filename
Good point. Also, if the stuff_separated_by_underscores wraps
On Sat, Jan 10, 2004 at 06:26:30PM -0500, Marty Landman wrote:
At 06:02 PM 1/10/2004, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote:
If this occures more than once on a line we should have the line as this:
perl -pi.bak -e 's/\s+\w+_\w+\.?//g;'
At 06:36 PM 1/10/2004, Matthew Seaman wrote:
Err --- Gary Kline was the OP asking how to do this: I think you mean
Bernard El-Hagin's solution?
% perl -i.bak -pe 'tr/_/ /' files
That doesn't do the right thing.
Woops, not only can't I read the question right, can't read the poster's
name
On Sat, Jan 10, 2004 at 11:36:45PM +, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 06:26:30PM -0500, Marty Landman wrote:
At 06:02 PM 1/10/2004, Matthew Seaman wrote:
On Sat, Jan 10, 2004 at 11:39:07PM +0100, Björn Andersson wrote:
If this occures more than once on a line we should
: [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 4:24 PM
Subject: Re: Cvsup script question
Charles Howse [EMAIL PROTECTED] writes:
Hi,
I'm cvsup'ing from a script in /usr/local/etc/periodic/daily.
Here 'tis:
#!/usr/local/bin/bash
Echo
Echo Output of cvsup:
/usr/local
On Mon, Aug 25, 2003 at 03:32:25PM +0100 or thereabouts, Marco Gon?alves wrote:
Hi, i did some minor alterations to the script by
#!/usr/local/bin/bash
/usr/local/bin/cvsup -g -L 0 /etc/cvsupfile # Keep quiet except for errors
/usr/local/sbin/portsdb -Uu /dev/null # Hopefully, show
Charles Howse [EMAIL PROTECTED] writes:
Hi,
I'm cvsup'ing from a script in /usr/local/etc/periodic/daily.
Here 'tis:
#!/usr/local/bin/bash
Echo
Echo Output of cvsup:
/usr/local/bin/cvsup -g -L 2 /etc/cvsupfile
Echo
Echo Output of portsdb:
/usr/local/sbin/portsdb -Uu
Echo
Echo Output
Hi,
I'm cvsup'ing from a script in /usr/local/etc/periodic/daily.
Here 'tis:
#!/usr/local/bin/bash
Echo
Echo Output of cvsup:
/usr/local/bin/cvsup -g -L 2 /etc/cvsupfile
Echo
Echo Output of portsdb:
/usr/local/sbin/portsdb -Uu
Echo
Echo Output of portversion:
/usr/local/sbin/portversion
It
David Banning [EMAIL PROTECTED] writes:
| I am running a php program in a browser which eventually compiles some files
| and emails them to a person of their choosing. The problem is that the system
| identifies the browser user as nobody.
|
| I send the mail using a line something like;
|
|
On 2003-04-04 23:45, David Banning [EMAIL PROTECTED] wrote:
I am running a php program in a browser which eventually compiles some
files and emails them to a person of their choosing. The problem is
that the system identifies the browser user as nobody.
I send the mail using a line something
system is nobody.
Try this:
cat textfile | \
mutt -s Subject here \
-x -e 'set envelope_from=yes' -e 'my_hdr From: [EMAIL PROTECTED]' \
-a attachment1 -a attachment2 \
[EMAIL PROTECTED]
The change is the addition of the two -e options
Have you considered using php's mail function? You can specify a
sender by specifying headers.
Bill, I never even considered this even as a possibility.
Thanks for the tip.
___
[EMAIL PROTECTED] mailing list
David Banning wrote:
I am running a php program in a browser which eventually
compiles some files and emails them to a person of their
choosing. The problem is that the system identifies the
browser user as nobody.
I send the mail using a line something like;
cat textfile | mutt
I am running a php program in a browser which eventually
compiles some files and emails them to a person of their
choosing. The problem is that the system identifies the
browser user as nobody.
I send the mail using a line something like;
cat textfile | mutt -sQuote/Attachments -afile1 -afile2
cat textfile | mutt -sQuote/Attachments -afile1 -afile2 [EMAIL PROTECTED]
but the problem is that the recipient sees the sender address as
from [EMAIL PROTECTED], when I want it seen as [EMAIL PROTECTED].
I have the name of the user available in the script but I see no
way of running
I do use Exim and all I have to tell it is:
trusted_users = www
It would then allow the webserver to set the correct address. I am not sure
how Sendmail, Postfix or any other MTA does this.
Thanks for the idea. Sendmail is a bit of a nightmare to tangle
with, but I'll start looking around
On Sat, Apr 05, 2003 at 02:20:54AM -0500, David Banning wrote:
I do use Exim and all I have to tell it is:
trusted_users = www
It would then allow the webserver to set the correct address. I am not sure
how Sendmail, Postfix or any other MTA does this.
Thanks for the idea.
61 matches
Mail list logo