Console Input from a file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Console Input from a file
# 1  
Old 09-15-2010
Data Console Input from a file

hi 2 all

whatever in a file that line have to come in console screen .. when i execte that script ...

>cat abc
date
ls

>./abc
>date ---->that line hav to come here
> ls ----> that line hav to come here


please anyone help me !
# 2  
Old 09-16-2010
what happens when you type ./abc? Is abc executable? Please post the entire output of ls -l abc and what happens when you run it..
# 3  
Old 09-16-2010
ya abc file is executable

-rwxr-xr-x 1 oaa omnesys 8 Sep 16 10:55 abc


if i run that file

i am getting like this

OTP-UAT:/home/ponmuthu=>./abc
Thu Sep 16 10:56:13 IST 2010
abc feed feed.mnm tbt_trbl_shtr.sh

instead of getting like that

expected Output is

OTP-UAT:/home/ponmuthu=>./abc
date
ls

without type cat i need same line what in that abc exectable file
# 4  
Old 09-16-2010
You want to execute a script that just prints the contents of itself? You want the output of "./abc" to match the output of "cat abc"? I don't think that's an easy problem to solve. Or do you not care what the output of 'cat abc' looks like as long as the output of "./abc" looks like you want it to? If that's the case, it's easy:

Code:
echo date
echo ls

would do what you want (among a million other possibilities). Hmm... it doesn't look like that's what you want though. Why exactly do you want it to do this? If you tell us the actual problem you're trying to solve we could probably be more helpful in suggesting strategies to solve it.
# 5  
Old 09-17-2010
No Once i execute that file
i want content of that file hav to come in console ...

in that file ` ls ` cmd is thr na ..

>./abc
>ls
abc def

so that content hav to come in console after that will execute ..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris LDOM not accepting keyboard input at console

Ran into this issue today and wanted to share how I fixed it as there is not a lot a lot of info online on this issue. We upgraded our NetApp controllers to Ontap 9 and reboot all our iSCSI attached LDOMs after. One of the LDOM did not come up cleanly and it would not accept any keyboard inputs... (0 Replies)
Discussion started by: ncherukuri
0 Replies

2. UNIX for Beginners Questions & Answers

Linux Console for Interactive Input Script

Hi there, How do I enter command to the interactive console. I was able to do it via the first line. What if I have more lines to input into the interactive console from line 3 onwards. Is there a more easier way? (echo -e "load openvas" ; echo -e "openvas_help") | msfconsole ... (4 Replies)
Discussion started by: alvinoo
4 Replies

3. Homework & Coursework Questions

Removing punctuations from file input or standard input

Just started learning Unix and received my first assignment recently. We haven't learned many commands and honestly, I'm stumped. I'd like to receive assistance/guidance/hints. 1. The problem statement, all variables and given/known data: How do I write a shell script that takes in a file or... (4 Replies)
Discussion started by: fozilla
4 Replies

4. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

5. Shell Programming and Scripting

XML variable for input in same input file

Dear All , i stuck in one problem executing xml .. i have input xml as <COMMAND name="ARRANGEMENT.WRITE" timestamp="0" so="initial"> <SVLOBJECT> <LONG name="CSP_PMNT_ID" val="-1"/> <MONEY name="CSP_CEILING" amount="0.0" currency="AUD"/> ... (6 Replies)
Discussion started by: arvindng
6 Replies

6. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

7. UNIX for Dummies Questions & Answers

Windows to Linux remote console using VNC brings up blank console screen with only mouse pointer

:confused:Hi This was installed on the Linux box a few weeks back by a guy that no longer works for us. All worked fine until last week. Now when we connect its just a blank screen with no icons. I get a whole bunch of errors when starting the service too: Tue Feb 23 14:29:45 2010 ... (1 Reply)
Discussion started by: wbdevilliers
1 Replies

8. Shell Programming and Scripting

Need script to take input from file, match on it in file 2 and input data

All, I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then Insert file1 column2 to file2 column4 then create a new file. File1: 12345 Sam 12346 Bob 12347 Bill File2:... (1 Reply)
Discussion started by: darkoth
1 Replies

9. Shell Programming and Scripting

Reading specific contents from 1 input files and appending it to another input file

Hi guys, I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help. I have 2 input files (example given below) Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
Discussion started by: sksahu
5 Replies

10. Programming

Changing stdin from file redirection to console input

Hi I am doing file redirection at console for use by my binary. %console%> bin &lt inputfile After reading in the entire file, I want my program to continue taking input from the console. So essentially I want to redirect stdin back to console. But I cant figure out how to do it. I am... (4 Replies)
Discussion started by: nauman
4 Replies
Login or Register to Ask a Question