Simple form using bash without utilities.
Longhand OSX 10.14.1, default bash terminal.
Code:
Last login: Thu Jan 31 18:23:42 on ttys000
AMIGA:amiga~> NAMES=( John Paul George Ringo )
AMIGA:amiga~> EXCLUDE_NAME='Ringo'
AMIGA:amiga~> STRING=""
AMIGA:amiga~> for (( N=0; N<${#NAMES[$@]}; N++ ));do if [ "${NAMES[$N]}" != "${EXCLUDE_NAME}" ]; then STRING="${STRING} ${NAMES[$N]}"; fi; done
AMIGA:amiga~> echo ${STRING}
John Paul George
AMIGA:amiga~> _
I have a variable which consists of a string like this:
001 aaabc 44 a bbb12
How do I extract each substring, delimited by the spaces, into new variables - one for each substring?
eg var1 will be 001, var2 will be aaabc, var3 will be 44, var4 will be a, etc?
I've come up with this:... (2 Replies)
Hello,
I am an intermediate scripter. I can usually find and adapt what I need by searching through previous postings, but I'm stumped.
I have a string with the format "{Name1 Release1 Type1 Parent1} {Name2 Release2 Type2 Parent2}". It is being passed as an argument into a ksh script. I need to... (5 Replies)
I have a UNIX shell where:
LEVEL=dev
SITE=here
and WHEREIAM=/tmp/$SITE/location/$LEVEL
I want to echo $WHEREIAM in such a way that I get it back with all the environment variables resolved (/tmp/here/location/dev).
This command will be used in a shell script. (5 Replies)
Hi all,
I'm trying to extract the name of a script that is being run with a full path. i.e.
if the script name is /some/where/path/script_name.ksh
I'd like to extract only: script_name
i know that it is possible to do so in two phases:
echo "${0##*/}" will give me script_name.ksh
and... (4 Replies)
In a bash script I've set a variable that is the directory name of where an executable lives.
the_dir=`dirname $which myscript`
which equates to something like "/path/to/dir/bin"
I need to cut that down to remove the "bin" so I now have "/path/to/dir/".
This sounds easy but as a... (2 Replies)
Hello,
I have a paramter $param consisting just of two literals and want to split it into two parameters, so I can combine it to a new parameter <char1><string><char2>, but the following code didn't work:
tmp_PARAM_1=cut -c1 $PARAM
tmp_PARAM_2=cut -c2 $PARAM... (2 Replies)
Hi All,
I am facing a problem and I am not able to solve it.
I have already searched google, but nothing (maybe I am not using the correct key words).
As a database query result, I have a file like below:
fmv:/home/fmv/tmp>cat TestBackRef.txt
/^TEST\(\{4\}\)X\{12\}Y\.txt$/\0#\1/#Test... (2 Replies)
Hi,
I need to convert string "(joe.smith" into "joe_smith"
i.e. I need to remove the leading opening brace '(' and replace the dot '.' with an under score '_'
can anyone suggest a one liner ksh script or unix command for this please (3 Replies)
Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
Please use code tags... (7 Replies)
Hi, I have a variable with grep output like this:
WORDS=$(grep -r -c -i -E "palindrom" /"$DIRECTORY"/)
so "echo "$WORDS"" could be:
//directory/file1.txt:0
//directory/file2.txt:0
//directory/file3.txt:3
//directory/file4.txt:1
//directory/file5.txt:0
I need to "sed" my variable... (3 Replies)
Discussion started by: Hornys
3 Replies
LEARN ABOUT NETBSD
ne
NE(4) BSD Kernel Interfaces Manual NE(4)NAME
ne -- NE2000 and compatible Ethernet cards device driver
SYNOPSIS
ISA boards
ne0 at isa? port 0x280 irq 9
ne1 at isa? port 0x300 irq 10
ne* at isapnp?
MCA boards
ne* at mca? slot ?
PCI boards
ne* at pci? dev ? function ?
PCMCIA
ne* at pcmcia? function ?
acorn32
ne* at podulebus?
amiga
ne* at zbus0 # AriadneII, X-surf
amigappc
ne* at zbus0 # AriadneII, X-surf
atari
ne0 at mainbus0 # EtherNEC on Atari ROM cartridge slot
evbarm
ne0 at obio? addr 0x0e000200 intr 5 # on-board Asix AX88796
evbsh3
ne0 at mainbus? # Realtek RTL8019AS
x68k
ne* at intio0 addr 0xece300 intr 249 # Nereid Ethernet
ne* at intio0 addr 0xeceb00 intr 248 # Nereid Ethernet
neptune0 at intio0 addr 0xece000 intr 249 # Neptune-X
neptune1 at intio0 addr 0xece400 intr 249 # Neptune-X at alt. addr.
ne* at neptune? addr 0x300
DESCRIPTION
The ne device driver supports NE2000 and compatible (including NE1000) Ethernet cards. While the original NE2000 is designed for ISA bus,
the compatible Realtek 8019 chip is widely used on various local busses and ne driver also supports such devices on various machines.
MEDIA SELECTION
The Realtek 8019 (ISA, ISAPnP, some PCMCIA) and Realtek 8029 (PCI) NE2000-compatible Ethernet chips include support for software media selec-
tion. If one of these chips is detected by the driver, the list of supported media will be displayed.
For all other chips supported by the ne driver, media selection must be performed either via card jumper settings or by vendor-supplied con-
figuration programs.
DIAGNOSTICS
ne0: where did the card go? The driver found the card, but was unable to make the card respond to complete the configuration sequence.
SEE ALSO ifmedia(4), intro(4), isa(4), isapnp(4), mca(4), pci(4), pcmcia(4), ifconfig(8)BSD April 3, 2010 BSD