Bash interactive Script Required


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash interactive Script Required
# 1  
Old 02-17-2016
Display Bash interactive Script Required

Dear All,

Please help in creating a bash script to fetch records from multiple files the script should ask inputs of file type and column level input(at least 4 col of each file type)

I have 4 sort of Files, A,B,C,D. file names are like A_0112.unl, A_01215.unl, A_0001.unl and same with B C and D.

Columns in A are below:
Code:
$1== number
$2== date and time which is like |20160216124800|
$3== duration which is like "|300|" and its in seconds
$4== Charges which is like "|1|" and it is in cents

Columns in B are below:
Code:
$1== date and time which is like |20160216124800|
$2== number
$3== duration which is like "|300|" and its in seconds
$4== Charges which is like "|1|" and it is in cents

Columns in C are below:
Code:
$1== duration which is like "|300|" and its in seconds
$2== Charges which is like "|1|" and it is in cents
$3== number
$4== date and time which is like |20160216124800|

Columns in D are below:
Code:
$1== Charges which is like "|1|" and it is in cents
$2== duration which is like "|300|" and its in seconds
$3== number which is like |01171011105|
$4== date and time which is like |20160216124800|

Now when i start the script it should ask below inputs:
Code:
Input 1) Please enter file Type, Options are below:
1==A
2==B
3==C
4==D

Input 2)Please enter number which should start from 0117XXXXX.

Input 3)please enter date which should be like YYYYMMDD

Input 4)Please enter time, option are below:
1==000000 to 235959
2==000000 to 060000
3==060000 to 120000
4==120000 to 180000
5==180000 to 235959

once all the inputs are given the output should print all entries(columns) in the fully matched file. thanks.

Last edited by Don Cragun; 02-17-2016 at 02:04 PM.. Reason: Add CODE and ICODE tags.
# 2  
Old 02-17-2016
provide us the code on what you have tried , will help you out with the errors.
# 3  
Old 02-17-2016
Please use code tags as required by forum rules!

And, post input samples and desired output.
# 4  
Old 02-17-2016
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum as specified in the guidelines for posting homework.

If this is a homework assignment, please close this thread and repost with a completely filled out template from the guidelines above.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash -c interactive scripts

i have to run the following script through a pipe: script.sh: #!/bin/bash echo "Hello World" echo -e "The \033 here's how its currently being run: bash -c "$(cat script.sh)" This is an interactive script. the problem is, when i run it this way, if you go to another terminal and... (4 Replies)
Discussion started by: SkySmart
4 Replies

2. Shell Programming and Scripting

Bash interactive scripts

i have a script that contains: script.sh #!/bin/bash echo -e "\t\t\t0. Exit" echo -e "\t\t\t1. Help" echo -e "\t\t\t2. Notes" echo -e "\t\t\t3. Classes" echo "${newline}" echo -n -e "\t Please enter option number : " read Type case $Type in 1) clear ... (1 Reply)
Discussion started by: SkySmart
1 Replies

3. Shell Programming and Scripting

Passing arguments to interactive program through bash script, here document

Dear Users, I have installed a standalone program to do multiple sequence alignment which takes user parameters to run the program. I have multiple sequence files and want to automate this process through a bash script. I have tried to write a small bash code but its throwing errors. Kindly... (13 Replies)
Discussion started by: biochemist
13 Replies

4. Shell Programming and Scripting

Creating an Interactive Bash Script to Analyze a PCAP

Hello Everyone, I am currently trying to write a Bash Script to call a PCAP file. The command I will use in the script will be the following: tshark -r test.pcap -T fields -e frame.number -e frame.time -e eth.src -e eth.dst -e ip.src -e ip.dst -r ip.proto -E header=y -E separator=, quote=d -E... (4 Replies)
Discussion started by: MrTuxor
4 Replies

5. Shell Programming and Scripting

Non interactive su in bash script

Hi, I have a python gui which allow users entering the root password, then a bash script is called to run "su" with the root password on the background. I could find a way to run "su" with a password. How to run "su" in a bash script without password prompt? Thank you. (4 Replies)
Discussion started by: hce
4 Replies

6. Shell Programming and Scripting

How to filter required data from file using bash script?

Hi All , I have one file like below , Owner name = abu2-kxy-m29.hegen.app Item_id = AX1981, special_id = *NULL*, version = 1 Created = 09/01/2010 12:56:56 (1283389016) Enddate = 03/31/2011 00:00:00 (1301554800) From the above file I need to get the output in the below format ,i need... (3 Replies)
Discussion started by: gnanasekar_beem
3 Replies

7. Shell Programming and Scripting

Bash interactive installation script

Hi, for an exercise I need to write a script that will ask the user about each package in a (local) repository and install it or not according to the user's input. I am fairly new to scripting, so I did not get very far. Here is what I came up with. I really appreciate your help. ... (1 Reply)
Discussion started by: Softsmid
1 Replies

8. Shell Programming and Scripting

Execute interactive bash menu script in browser with PHP

I have an interactive menu script written in bash and I would like use PHP to open the interactive bash menu in a browser. Is this possible? Using the sytem() function in php runs the script but it's all garbled. Seems like maybe a terminal window needs to be opened in php first? ... (1 Reply)
Discussion started by: nck
1 Replies

9. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

10. Homework & Coursework Questions

Help with Interactive / Non Interactive Shell script

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (1 Reply)
Discussion started by: rits
1 Replies
Login or Register to Ask a Question