Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-09-2008, 03:21 AM   #1
LQ Newbie
Registered: Jul 2006
Posts: 14

Rep: Reputation: 0
bash input redriction problem

Hi there

echo -e "$inp" >inf2 -newca <inf2
echo -e -n "$inp" | -newca
" -newca <inf2" works as desired, while "echo -e -n "$inp" | -newca" does not. I do not understand why, any clues?

Greets chris
Old 01-09-2008, 05:04 AM   #2
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

Rep: Reputation: 199Reputation: 199
does the -e -n inhibit newlines?

if so the perl read is waiting for a newline char probably.
Old 01-09-2008, 06:34 AM   #3
LQ Newbie
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Hi bigearsbilly
Originally Posted by bigearsbilly View Post
does the -e -n inhibit newlines?

if so the perl read is waiting for a newline char probably.
the -n does in fact not add a newline after the echo command, but I composed the $inp string with the required "\n" chars (that's what the -e is required for, at least acc. man echo). The proof is, that is actually runs " -newca <inf2". Remember, inf is generated from same "echo -e "$inp" >inf2" $inp string. finally, I get the same behaviour when running "echo -e "$inp" | -newca"
actually here is the way i generate inp:
you can see the new lines (\n) and the parameters like $cc (country code) ...
again, if $inp is echoed ot a file, and this is redirected to it runs perfectly. The passphrases have to be keyed in physically (desired imho), the rest is read from $inp respectively inf2

besides: i run Suse 10.3, 64 bit, last updated 3 hours ago, xen-pae, AMD X2 64, 4G ram, Raid5 LVM.

any other idea?


bash, input, piping, redirection

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
User input into Bash scripts and checking validity of user input?? helptonewbie Programming 8 07-07-2008 06:40 PM
bash input/output redirect problem greno Programming 2 12-31-2006 03:23 PM
bash - how to take input as a variable? trees Linux - General 1 02-19-2004 04:09 PM
my mouse input is takes as keyboard input in BASH e1000 Slackware 5 12-08-2003 03:00 PM
Text input in bash? pk21 Programming 12 06-05-2003 09:23 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration