04-05-2009
Help make a program in cshell that searches and prints in a specific format
say I have a file named phones
in that file every line is like that
lastname^firstname^phone
how can I make a program in cshell that searches for a specific string
in phones and echos the result (if found) like that:
lastname1
firstname1
phone1
------------------
lastname2
firstname2
phone2
and so on....
I only know grep and it prints
lastname1^firstname1^phone1
lastname2^firstname2^phone2
...well thank you anyway
![Smilie Smilie](https://www.unix.com/images/smilies/smile.gif)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Experts,
I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ?
Thanks
Jim (2 Replies)
Discussion started by: jimmynath
2 Replies
2. Shell Programming and Scripting
Hi all, i hope i got this in the right place, what i am trying to do is make a program only run by root, ie
for instance user fred is logged in and uses firefox, what id like to do is change that so that when fred wants to use firefox he will be asked to enter root password before he is allowed to... (14 Replies)
Discussion started by: dave123
14 Replies
3. Programming
Hi,
I'm trying to create a C program that functions like the make utility in UNIX for personal use. My program would read in from a generic makefile and execute whatever is in that makefile but I'm not sure as to where I should start coding.
I would appreciate any help.
Thanks. (1 Reply)
Discussion started by: kratos.
1 Replies
4. Shell Programming and Scripting
Hello all!
I have a C program that runs on a loop, prompting the user for input until it is exited. I want to create a shell script that can run this program and provide input. How can I do this? I have investigated 'expect' and piping to stdin, but haven't had any success. Any help is... (2 Replies)
Discussion started by: radish04
2 Replies
5. Shell Programming and Scripting
Hi,
I have the following text file:
8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm
11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies
6. Shell Programming and Scripting
Hello all,
I need to change a number in a file by adding some residuals respectively
To make it clear,
I need to add 0.11 to the number between 24-28 (which is below the SECON) for all the lines starting with FRR1
or I need to add 0.13 to the number between 24-28 (which is below the... (9 Replies)
Discussion started by: miriammiriam
9 Replies
7. UNIX for Dummies Questions & Answers
Not sure why this is not working. Please advice:
#!/bin/sh
DIR=`date +"%m-%d-%y"`
echo $DIR
] && mkdir $DIR (2 Replies)
Discussion started by: iaav
2 Replies
8. Shell Programming and Scripting
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Discussion started by: Ferocci
8 Replies
9. UNIX for Dummies Questions & Answers
Hello All,
My question has to do with a Remote Desktop Session going from my Linux HOST to a Windows GUEST.
Linux OS: OpenSuSE 11.4 i586
Windows OS: Windows Server 2003
For some reason after I have run rdekstop to connect to the Windows Guest, whenever I click on the Shift key I get the... (0 Replies)
Discussion started by: mrm5102
0 Replies
10. Shell Programming and Scripting
Hi All,
Your help on the below requirement is highly appreciated.
I am building a program which should pick the file from a source directory and place them into target directory. While selecting the file in source it should look for some pattern in the file name.
Ex:
File Name 1:... (10 Replies)
Discussion started by: bharath561989
10 Replies
LEARN ABOUT CENTOS
loopctrl
LOOPCTRL(8) Linux System Administration LOOPCTRL(8)
NAME
loopctrl - configure isdnloop ISDN driver
SYNOPSIS
loopctrl [-d Driver-Id] action options ...
DESCRIPTION
loopctrl is used to setup the isdnloop ISDN driver.
OPTIONS
-d Driver-Id
selects the virtual S0 interface named by Driver-Id. Driver-Ids are defined during driver initialisation. See isdnloop(4) for a
description of the syntax to be used for modularised and monolithic driver versions. This option must be used to identify the vir-
tual S0 interface if more than one S0 interface is existent. If a single virtual S0 interface is used, it may be omitted. If using
more than one virtual card, support for the other cards is enabled with the add action of loopctrl. Ids may not start with digits or
small x, because these values are misinterpreted as numeric parameters by insmod. For loading the module, always the newest modu-
tils package should be used to avoid problems during load.
The following actions may be given to loopctrl.
add [id]
enables support for an additional virtual card in the driver. If id is missing, adds a card with an id given by the system. with id
given, adds a card with an Id given by the user. Ids are checked against conflicts, and if a conflict happens, replaced by the sys-
tem in the same manner as if no Id was supplied.
leased on|off
switches between normal (dialup) and leased-line mode. Leased-line mode is intended for usage with S64K-lines or - if both channels
are used - for S02. These lines do not have a D-channel. When leased-line mode is enabled, the driver simulates incoming calls using
special "phone-numbers" for calling and called address which are generated as follows:
Calling number:
LEASEDx
where x is the internal slot-number of the S0 interface. This number starts with 0 for the first S0 interface and is
incremented by one for every S0 interface configured using the add action.
Called number:
x
where x is equal to the channel number of the calling S0 interface starting with 1.
start protocol phone1 [phone2 phone3]
starts the driver with the given D-channel protocol. If protocol is 1tr6, only phone1 has to be given. It is meant to be the base
number of the virtual S0 interface to which the EAZ is appended. If protocol is dss1, phone1, phone2 and phone3 have to be given and
represent the three MSNs of the virtual S0 interface.
dump is available if the program is configured using the --enable-dump option only. The contents of internal driver variables is dumped
on stdout.
BUGS
This program and the isdnloop driver are ALPHA code. The main intention for this driver is for testing the link level and applications.
AUTHOR
(C) 1997 by Fritz Elfert <fritz@isdn4linux.de>
SEE ALSO
isdnctrl(8), isdnloop(4), isdninfo(4), isdnctrl(4), ttyI(4).
isdn4k-utils-3.13 1999/09/06 LOOPCTRL(8)