but it is too long winded unforunately though this is the only way I know, does anyone know of a quicker way to do this as it takes a very long time to run ...after doing all the cutting it pastes everything back into a newfile called "joined", but it just seems like a hassle and I thought someone out there must know of a better way to achieve the same results(bearing in mind it does some awking and find and replacing into the bargain
Thanks for that Vino, you guys make it look so simple, that sure looks like a more cleaner professional approach, I'll give it a try asap ...many thanks again and for your prompt response, also if you don't mind me asking what type of programming/style is your coding most similar to? as I would like to study it when I get a little more time.
Sorry to take so long to get back to you, I am finally getting round to implementing the code as you suggested, but right off the bat I get the following message
UX:sh (./Iptestger): ERROR: Bad substitution
code
#! /bin/sh
while read line
do
col1=${line:0:1}
echo $col1
done < WAITING
/bin/sh on most (all?) linux distributions is a link to bash.
If you're running on just about any other UNIX type system then sh will not have the functionality described. You need to use bash itself (instead of sh).
# ls -lt /usr/bin/*sh*
-rwxrwxrwx 1 root other 271 Nov 30 2001 /usr/bin/shtty
lrwxrwxrwx 1 root other 5 Oct 19 1999 /usr/bin/rsh -> remsh
lrwxrwxrwx 1 bin bin 5 Oct 19 1999 /usr/bin/rksh -> ./ksh
lrwxrwxrwx 1 bin bin 13 Oct 19 1999 /usr/bin/restsh -> ../../sbin/sh
lrwxrwxrwx 1 bin bin 13 Oct 19 1999 /usr/bin/jsh -> ../../sbin/sh
lrwxrwxrwx 1 bin bin 13 Oct 19 1999 /usr/bin/sh -> ../../sbin/sh
-rwsr-xr-x 1 root bin 25696 Jun 4 1999 /usr/bin/remsh
-rwxr-xr-x 1 bin bin 80040 Jun 4 1999 /usr/bin/rshd
-rwxr-xr-x 1 bin bin 175948 Jun 4 1999 /usr/bin/ksh
-rwxr-xr-x 1 bin bin 7369 Jun 4 1999 /usr/bin/admrshell
-rwsr-xr-x 1 root sys 38592 Feb 26 1998 /usr/bin/shl
-r-xr-xr-x 1 bin bin 223120 Apr 2 1997 /usr/bin/csh