get charachters from positionX to positionY



  • 1. phreads and processes
    I have a program that uses pthreads. I now need to run it in multiple processes also. I guess the question would be if I have added shared memory and SysV semaphores, do I still require the pthread mutexes and events; i.e. do pthreads honor the SysV semaphores or can I substitute the semaphores for the pthread mutexes and events? It still needs to be multi-threaded. Thanks,
  • 2. implementation of FD_SET
    Hello, All! Suppose I have this piece of code: fd_set readfds; FD_ZERO(&readfds); FD_SET(0, &readfds); FD_SET(1, &readfds); Preprocessor expands it into: <skipping FD_ZERO, as I'm interested in FD_SET only> __asm__ __volatile__ ("btsl %1,%0" : "=m" (((&readfds)->__fds_bits)[((0) / (8 * sizeof (__fd_mask)))]) : \ "r" (((int) (0)) % (8 * sizeof (__fd_mask))) : "cc","memory"); __asm__ __volatile__ ("btsl %1,%0" : "=m" (((&readfds)->__fds_bits)[((1) / (8 * sizeof (__fd_mask)))]) : \ "r" (((int) (0)) % (8 * sizeof (__fd_mask))) : "cc","memory"); I understand what "btsl" instruction is doing, and also I know 'readfds' is array of integers, in which every element's bit corresponds to descriptor. But I can't understand how is it done in this macro, seems the trick is within '(((&readfds)->__fds_bits[...]'.... Thanks in advance. With best regards, Roman Mashak. E-mail: XXXX@XXXXX.COM
  • 3. Makefile error?
    Hi there, Silly situation keeps me from continuing w/ my tests... I'm trying to execute the following makefile in a Linux machine: ********************************* all: listen speak listen: listen.o gcc -g listen.c -o listen speak: speak.o gcc -g speak.c -o speak clean: \rm -f listen speak squeaky: make clean \rm -f listen.o speak.o #tar: # cd ..; tar czvf socket.tar.gz socket/Makefile socket/listen.c socket/speak.c socket/README; cd socket; mv ../socket.tar.gz . ********************************* But for some reason, I get this error: *************** eos% ./Makefile ./Makefile: line 1: all:: command not found ./Makefile: line 2: listen: command not found ./Makefile: line 4: listen:: command not found ./Makefile: line 7: speak:: command not found ./Makefile: line 10: clean:: command not found ./Makefile: line 13: squeaky:: command not found *************** any idea what is this about? Thank you very much, Fernando
  • 4. get current user name?
    How do I retrieve the username of the currently logged in user? I basically to check if the user is logged in as root and if not, exit the program. I though about using the LOGNAME environment variable, but if a regular user used su root, the environment variable still has the user's login name.

get charachters from positionX to positionY

Postby shulamitm » Wed, 16 May 2007 21:00:41 GMT

I have a file with list of rows.
I need to get the charachters in position 69-79 from each row.

for example:
from the following line:
000000059026255852  03BKVAKOV  BE1193YN20070228104737AKUVMTG
048605612   0000XXX

I need the the strings "048605612"

How can I do it?


Re: get charachters from positionX to positionY

Postby Fred Kleinschmidt » Wed, 16 May 2007 23:29:15 GMT

cut -c 69-79 filename
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Aero Stability and Controls Computing

Similar Threads:

1.OT - as Linux gets more likes windows, windows gets more like Linux

[Note, I know its beta etc etc, this is not me being a troll, its just a 
little bit of humor]

This assumed me, this is the command line for installing iis

start /w pkgmgr /l:log.etw 

Now that's the longest ever command line option I have seen, as more and 
more bits of Linux are made friendly we are getting complex cmd line things 
to run, will this make us windows users look more intelligent? we will have 
lots of different colored msh prompts open with outputs off of commands :)

....... I presume this is due to a bug in add windows feature but joking 
aside, its nice to see that things can be scripted as for iis I think this 
was possible since version 4.


2.[News] Eee PC Gets Beryl in the Debian Repositories, Gets Praised

3.[News] GNU/Linux Gets More Reliability, Windows Gets Even Less Reliable

4.[News] Sony Playstation 3 Gets Better, Gets Much More Affordable (While Microsoft Goes the Other Way)

5.[News] Embedded Linux Gets More Sophisticated, Tiny Linux Board Gets LCD Module

6. [News] Linux-based Nokia Tablet Gets a High Score, Another Linux PDA Gets Better

7. [News] Linux Tablet Gets Rave Reviews, iPhone Gets Some Yawns, Apple Helps in Promoting Linux

8. [News] Open Handset Alliance Gets New Member, OpenMoko Gets Enlightenment

Return to unix


Who is online

Users browsing this forum: No registered users and 38 guest