Sponsored Content
Top Forums Shell Programming and Scripting problem piping input to script with echo Post 302328910 by mcdef on Thursday 25th of June 2009 12:25:39 PM
Old 06-25-2009
problem piping input to script with echo

I am trying to have a script run without interaction from the command line. So in my script i have a line like this

echo -e "\n\n\ny\ny\n" | ./script

the goal being the ability to mimic 3 Enter presses and 2 'y/n' responses with 'y' followed by enter.

For some reason tho, it is not accepting the 'y' when i run the script and is executing only the \n.

Any help is always appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

piping output to echo

Hi, I was wondering why ls * | echo does not print the contents of the directory to the screen? The way I see it, ls * returns a whole lot of information, and then we pipe all this info to echo, so surely it should all come to our screen! Is there a serious flaw in my understanding? ... (3 Replies)
Discussion started by: A1977
3 Replies

2. UNIX for Dummies Questions & Answers

echo command and piping

Hi, I have heard you can use the echo command and piping together and was wondering if you can help me out. I want to be able to use the echo command and pipe together to tell me how many files are in my current working directory, which have only my username read, write and execute... (4 Replies)
Discussion started by: rushhour
4 Replies

3. Shell Programming and Scripting

[SH] Problem reading input in script

Alright, so the goal of my script is to read text from standard input and store it into a file using the ex-editor: so far i've got this, but it doesn't work. #!/bin/s read text ex $1 >> HERE text HERE I don't get any errors either, so i don't know what i'm doing wrong. (7 Replies)
Discussion started by: Bertieboy7
7 Replies

4. Shell Programming and Scripting

Echo date variable from data input to a script

Hi, I'm trying to make a script which you type the year, select the month and day and then create the date in the format 2010-12-7. #!/bin/bash dia () { echo " Seleccione el dia:" select file in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Salir do... (6 Replies)
Discussion started by: iga3725
6 Replies

5. Shell Programming and Scripting

piping problem with xargs

I'm trying to pipe the output from a command into another using xargs but is not getting what I want. Running this commands: find . -name '33_cr*.rod' | xargs -n1 -t -i cut -f5 {} | sort -k1.3n | uniq | wc -l give the following output: cut -f5 ./33_cr22.rod cut -f5 ./33_cr22.rod ... 9224236... (7 Replies)
Discussion started by: ivpz
7 Replies

6. UNIX for Dummies Questions & Answers

[SOLVED] Piping Problem

Hey, I want to create a new file (devices) with the 39th and the 40th character of the line wich is in the array line and in the file drivers. But unfortunately my try doesn't work: sed -n '$linep' drivers | cut -c 39-40 | echo >>devices Perhaps one of you can help me. Thank you! emoly ... (0 Replies)
Discussion started by: emoly
0 Replies

7. Homework & Coursework Questions

Unix Piping Problem

Hey guys. I'm very new to Unix. I'm pretty fluent in Java and C, but I have never actually used Unix for anything. I am in an Operating Systems course now and I have an assignment to write a piece of code that involves forks and piping. I'm stuck. 1. The problem statement, all variables and... (6 Replies)
Discussion started by: itsjimmy91
6 Replies

8. UNIX for Dummies Questions & Answers

Auto input with echo

in cygwin, cron-config will ask two inputs: yes or no. 1st question, answer is no 2nd question, answer is yes my script: echo no | cron-config how do i pass yes to 2nd question ? (4 Replies)
Discussion started by: lawsongeek
4 Replies

9. Shell Programming and Scripting

Problem in taking input Shell script

I was writing a shell script, where i need to run a command through script and then take input from user and later terminate it. i am not sure how to take input in a proper format immediately after a command. example: below command line is used to import some data in to database (LDAP)... (3 Replies)
Discussion started by: Mridul17
3 Replies

10. Shell Programming and Scripting

Enhance existing script: Extract Multiple variables & Input in an echo string

Hi Experts I need your help to optimize my script to execute better as I have nearly 1M records & the script is taking close to 40 minutes to execute, so would need support on a faster alternative. Input: file {"house":"1024","zip":"2345","city":"asd","country":"zzv"}... (2 Replies)
Discussion started by: nk1984
2 Replies
gretl(1)							   econometrics 							  gretl(1)

NAME
gretl - GNU Regression, Econometrics and Time-series Library SYNOPSIS
gretl [ options ] [ datafile | scriptfile | sessionfile ] DESCRIPTION
gretl is an econometrics package, built around a shared library which may be accessed using a command-line client program (gretlcli) or a graphical user interface (gretl_x11). The program gretl is a wrapper script that calls the GUI if the DISPLAY environment variable is set, otherwise the command-line client. For details, please start up either the GUI or the command-line client and consult the online help, or read the printed manual, which is available in PDF format via the gretl website, http://gretl.sourceforge.net. OPTIONS
These are the options supported by the gretl_x11 program; gretlcli is a little different. -r script, --run script Open a script. -c, --dump Dump the configuration file. -d database, --db database Open a local database. -e, --english Force use of English. -r script, --run script Open a script. -w database, --webdb database Open a remote database. -h, --help Give help information and exit. -v, --version Give version information and exit. FILES
~/.gretl2rc per-user configuration file ~/.gretl directory for user runtime files ENVIRONMENT VARIABLES
HOME Specifies the user's home directory DISPLAY Specifies the X window display to use SEE ALSO
gretlcli(1) AUTHOR
The gretl team The gretl team 1.9.5 gretl(1)
All times are GMT -4. The time now is 08:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy