Register
It is currently Sat Oct 25, 2014 2:38 pm

Read Question


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Tue Feb 02, 2010 6:00 pm   

Joined: Tue Feb 02, 2010 4:10 pm
Posts: 3
I'm writing a simple script to take the input received from a embedded bar code scanner to keep appending to a script.
According to the manufacture of the Linux based scanner "the scanner data is redirected to appear as user input,and to just use the bash script 'read' command."
So my simple test script is:
Code:
#!/bin/sh
read foo
echo $foo >> /jffs2/data/foo.txt

Nothing is being sent to the foo.txt file.

Any ideas?
I have googled to no avail thinking maybe the read command requires something since enter is never pushed.
Any ideas on what I should try?


Top
 Profile  
 PostPosted: Tue Feb 02, 2010 10:29 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 550
isn't there an error message?

/jffs2/data/foo.txt surely doesn't exist, and you cannot create it, as it is at the root (/) of the filesystem.


Top
 Profile  
 PostPosted: Wed Feb 03, 2010 2:32 pm   

Joined: Tue Feb 02, 2010 4:10 pm
Posts: 3
Turns out the vendor of the scanner failed to tell me I had to change a setting to get the scanner to work this way in scripts.
meh.....
Thanks


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP