473,499 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shell script quoting and line read line

20 New Member
Hi all,

I am in the progress of consolidating my 2 NIS databases into 1. My first step is to get the NIS record for particular department. I have software.csv which contain list of name in.

software.csv:
John Travolta
Elthon John
Sean King Ston
Taylor Swif t
Nicole cage
.......

I create a simple script to read from software.csv , called genlist.sh

Expand|Select|Wrap|Line Numbers
  1. #!/bin/sh
  2. list_source="software.csv"
  3. cat $list_source | while read LINE; do
  4. N=$((N=1))
  5. echo '"${LINE}"'
  6. ypcat passwd | grep \"$LINE\"
  7. done
My output is:
John Travolta
grep: Travolta": No such file or directory
Elthon John
grep: John": No such file or directory
Sean King Ston
grep: King: No such file or directory
grep: Ston": No such file or directory
Taylor Swif t
grep: Swif: No such file or directory
grep: t": No such file or directory

I tried with many way to play around with my second last line but still not able to resolve.

Can anyone please help me in this case? Your help is appreciated!
Nov 12 '09 #1
1 2437
jsmithstl
14 New Member
Can you put an example of what your want your output to look like? How big is your software.csv file? Do you have to write this in sh or is perl an option?
Nov 14 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2997
by: gmuldoon | last post by:
Help please. Setup: RH EL3, PHP 4.3.5, Apache 1.3.29 running as user "nobody". Have a bash script named shell_script. Telnet to server as user "nobody" ("nobody" having been given /bin/bash...
2
3353
by: eichin | last post by:
One of my recent projects has involved taking an accretion of sh and perl scripts and "doing them right" - making them modular, improving the error reporting, making it easier to add even more...
6
1530
by: David M. Wilson | last post by:
Hello fellow users! I've been using Python in a couple of different environments for a few years now. I have quite often found that I have needed to deal with filenames which may contain...
10
2858
by: Nick Craig-Wood | last post by:
I'm trying to avoid using shell metacharacters in os.popen in a portable fashion. os.popen() only seems to take a string as the command which would need tricky quoting. os.popen2() can take a...
3
3689
by: FPGA05 | last post by:
Hello All, I am developing a small application in which I would need a C++ application to read the output from a shell script. A shell script keeps looking for user inputs and once the user...
3
3471
by: Eli Criffield | last post by:
I'm try run an ssh command in pexpect and I'm having trouble getting everything escaped to do what i want. Here's a striped down script showing what i want to do. -- #!/usr/bin/env python...
0
1661
by: paulhjwu | last post by:
Hi, I have problems running a couple of shell scripts from PHP. I found a similar posting, so I posted my question to the original author. But unfortunately the original author is not at the...
2
2827
by: Gerard Flanagan | last post by:
Hello, I have a third party shell script which updates multiple environment values, and I want to investigate (and ultimately capture to python) the environment state after the script has run....
7
6199
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.