Search Results

Search: Posts Made By: Damian Ibbotson
3,316
Posted By Damian Ibbotson
New z-shell user
Hi,

I've just downloaded the following files and have been tinkering with using zsh on my NT box.

Z-shell executable:

ftp://ftp.blarg.net/users/amol/zsh/zsh.exe.gz

Unix Utilities:
...
13,351
Posted By Damian Ibbotson
Welcome to the club ;-)
Welcome to the club ;-)
13,351
Posted By Damian Ibbotson
Using $* will separate the tokens with a space...
Using $* will separate the tokens with a space when it outputs them. "$*" will retain the IFS that you set.

$ IFS="," set a b c; echo $*; echo "$*"
$ a b c
$ a,b,c
6,825
Posted By Damian Ibbotson
I must be half asleep today ;-) This is what...
I must be half asleep today ;-)

This is what you want...

sed -n 's/^.*\(PATTERN\).*$/\1/p' yourFile

or even better (in terms of performance)...

sed -n '/PATTERN/s/^.*\(PATTERN\).*$/\1/p'...
13,351
Posted By Damian Ibbotson
Apologies, the 'function funcName' syntax should...
Apologies, the 'function funcName' syntax should set $0 to the name of the function.

The POSIX standard 'funcName () ' syntax would behave as I indicated earlier.

If you used the ksh...
6,825
Posted By Damian Ibbotson
Using sed... sed 's/^.*\(PATTERN\).*$/\1/'...
Using sed...

sed 's/^.*\(PATTERN\).*$/\1/' yourFile
13,351
Posted By Damian Ibbotson
$0 represents the name of the current shell (or...
$0 represents the name of the current shell (or script). Functions execute in the original shell, so $0 would still represent the script name.

The O'Reilly book is wrong! (although it is a great...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 11:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy