Programming :: Send Input From One Script To Another Menu Based Script?

Mar 24, 2010

I am trying compile a daily task that requires numerous steps all into one bash script to make life easier..My problem is that as part of this wrapper scripti have to call another script that is menu based and requires input from the user.Below is the menu

1) Start x Process
2) Start y Process
3) Start z Process

code]...

View 9 Replies


ADVERTISEMENT

Programming :: Select The Branch Based On The INPUT?

May 23, 2011

I want to select the branch based on the INPUT. Here is the program segment which uses the case statement.

case $INPUT in

1)branch="Computer Science";;
2)branch ="Electrical";;
3)branch = "Mechanical";;
4)branch= "Aerospace";;
esac

When I run this script, I am getting an error, Electrical command not found?

View 2 Replies View Related

Programming :: Bash - Calling A Specific Variable Based On User Input?

May 3, 2011

I'm trying to call a specific variable based on a user selection. For example:

Code: Select a file:

[1] foo.tar
[2] bar.tar

Enter a selection: I have already coded each possible selection to have its own variable. If the user selects 2 I need to select $SELECTED_TAR2, or if they select 1 I need to select $SELECTED_TAR1 and then do something like this behind the scenes:

Code: cp /home/user/$SELECTED_TAR2 /home/user/backup/$SELECTED_TAR2

I was thinking something like this:

Code: echo "Enter a selection: "
read -e SELECTED_NUMBER
cp /home/user/$SELECTED_TAR$SELECTED_NUMBER /home/user/backup

[code]....

View 2 Replies View Related

Programming :: Start A Process And Send Input To It In A Shell Script?

Jun 9, 2011

I'm building a Linux From Scratch system and partially automating it. I will likely want to do it again, and I would like to try to almost completely automate it.

My current approach is a script that takes an input file and sequentially runs each line in a new instance of bash. If one fails, it gives me the number of the step that failed so that I can use the "--step" option to resume after I fixed the issue.

This has some problems:
A varible created on one line will not be accessible on the next line. This is because each line is run in a separate shell (the reason for this is so that the commands in the input file and the script's internal variables can't interfere). You can't switch users or use chroot, again because each line is run in a separate shell.

What would be nice is to be able to start a bash process in the background and send commands to its stdin. I guess that a named pipe would work, but the named pipe will be gone after a chroot. Is there a way to do it without relying on the filesystem? Also, how do I know if the command failed?

View 14 Replies View Related

Programming :: Creating A Text Based Menu Structure In Bash?

May 15, 2009

Is it possible to create a text based menu layout in bash were it is possible to browse through. The menu list should look something like this:

----------------------------------------
user: root
colour: blue
number: 4
animal: dog
----------------------------------------

At the start the cursor should blink at the r from root so that text can be entered. When pressing the enter the cursor should go to the b from blue and so on. the imported thing is that all the text is visible also beyond the position from the cursor.

View 4 Replies View Related

Programming :: Splitting A File Based On The Values Read From An Input File?

Jul 27, 2010

I am splitting a file based on the values read from an input file. The below one is the script.

1)How do I add the header which is present in the original file to the new split files created?(For eg. pharmacyf conatins header as table column names. The new files created (ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat) are without the header).

2) Also the script is creating 0 byte files for the pharmacyids which are not available in the intial file? Can this be avoided?

for pharmacyf in *
do
tablename=`echo $pharmacyf |cut -f4 -d'.' `
while read pharmacyid
do
grep -w $pharmacyid $pharmacyf >> $OUT/ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat
done< inputfile
done

View 2 Replies View Related

Networking :: Specifying Output Int Based On Input Int And Source IP On Multiple 802.1q?

May 4, 2011

I have a pair of interfaces bringing in traffic from multiple vlans each. I need to route or forward traffic to and output interface based on the physical interface and source IP address in the packet.I have multiple ip rules to send traffic to custom routing tables and each of those custom tables had a default route out the appropriate interface, but traffic isn't flowing. Afterwards I tried using iptables and put an ACCEPT any statement in every chain of every table. What am I missing, ebtables maybe??

View 1 Replies View Related

Ubuntu :: Daemon That Executes Commands Based On Input Device In Use?

Jan 28, 2011

I have a computer with a trackpad and a touchscreen. I want to run unclutter if I use the touchscreen, and kill it when I use the trackpad or a USB mouse.

The I'm pretty sure the touchscreen is /dev/input/mouse0, and the trackpad is /dev/input/mouse1

I have a general idea of how this should work, but no idea what tools and commands to use to implement it.

View 1 Replies View Related

Ubuntu :: Send Keyboard Input To A Window?

Feb 10, 2011

I want to create a script to send input to an already open window from the command line. The reason that I want to do this is to automatically control a game running on a emulator screen. So, for example, I want to send commands like "up" "up" "w" "s" ..

View 4 Replies View Related

General :: Send Snmp Traps Based On Syslog Messages?

Oct 24, 2010

I need to be able to send snmp traps based on certain severity or content of syslog messages. Can this be done from standard linux? Alternatively, are there MIB's out there that support syslog events so I can get the status from snmp?

View 1 Replies View Related

Fedora :: Why GRUB Does Not Display Menu Based On Grub.conf/menu.lst

Jul 28, 2009

I am testing my crash recovery strategy for my linux system and I am having trouble with GRUB. I am basically restoring my backup (i.e. tar) unto a different hard drive, but I am having problems getting the machine to boot without me having to type the GRUB commands at the GRUB prompt that is presented when the machine boots up off the new hard drive. I have tried to restore the MBR in two ways (the 2nd one is the one that gets me to the GRUB prompt):

1. Get the MBR off the original drive and write it unto the new drive (all via dd), but that did not work at all: the machine hangs right away during boot up. It seems to hang right at the point where the BIOS tries to read the MBR.

Code:

On original drive:

# dd if=/dev/sda of=mbr+part.bin bs=512 count=1

On new drive (new drive is now in place of original drive):

# dd if=mbr+part.bin of=/dev/sda bs=1 count=446 conv=notrunc

2. By using the FEDORA rescue CD, I installed grub unto the new hard drive as follows:

Code:

# chroot /mnt/sysimage
# grub-install --root-directory=/boot hd0

reboot and remove FEDORA CD Using the 2nd option above, I get the GRUB> prompt during bootup. I can then boot into the system by issuing the commands that are in the menu.lst file, followed by the "boot" command. However, I would like for those commands to happen automatically, just like in the original configuration. It seems to me that GRUB is actually finding all its stage files because I doubt the GRUB program (the one displaying the prompt) fits entirely in the 446 bytes it has on the MBR. So, it must be loading its stage 2 (and stage 1.5??) files from my /boot partition. However, if GRUB is loading its stage files off the boot partition, why does it not load/read the menu.lst/grub.conf contained in the boot partition also?

Code:

# ls -l /boot
total 22888
-rw-r--r--. 1 root root 1274567 2009-05-27 16:39 System.map-2.6.29.4-167.fc11.i686.PAE
-rw-r--r-- 1 root root 1274538 2009-06-16 22:27 System.map-2.6.29.5-191.fc11.i686.PAE

[code]....

View 3 Replies View Related

Ubuntu :: Send Email Using Evolution - Could Not Connect To Smtp.gmail.com: Input/output Error

Sep 19, 2010

for like two weeks I have been trying to send email using evolution for some reason I always get the same Code: Could not connect to smtp.gmail.com: Input/output error

View 6 Replies View Related

Software :: Develop A Menu Based Administration Tools?

Sep 8, 2010

I just need to develop a menu based Administration tools in LINUX similar like SAM - HP and SMIT - AIX , should be in a position to work with tab and space bar and arrow keys ,should i write a code in c language only or i can implement the same in shell script itself.

View 13 Replies View Related

Ubuntu :: Send To Menu Does Not Appear On Right Click

Jul 22, 2011

I have a problem when I browse folders and want something to send to my nokia 6300 over bluetooth. In past I just right click and choose "send to..." >> "bluetooth" and choose device from list. Few weeks ago it stopped working - I click "send to" and nothing will happen, menu will not show. My ubuntu version is 10.04 (lucid)

View 3 Replies View Related

General :: Command Based Email Client To Send Email Through Secure Smtp?

Jul 26, 2010

In my Windows environment, I use email client such as Microsoft Outlook to connect to our email server to send email with the following configuration:

Incoming server (POP3): 995 - (requires with SSL)
Outgoing server (SMTP): 465 - (use encrypted connection SSL)

[code]....

And the mail server requires user ID login and password.how do I setup a text command based email client in my Linux (Centos 5.1) to send out email through the existing email server above, which is in another machine? The email client has to be text command based because I need to use command line to send notification email from anothar application installed in my Linux (Centos 5.1) Since the email client will only be used to send email notification, I don't require setting up of an email server in my linux.

View 2 Replies View Related

Ubuntu :: Keyboard Input Method Pref Menu Does Not Load?

Oct 16, 2010

I'm running Maverick, trying to change my input method from IBus to Anthy (Japanese) but whenever I click on System > Preferences > Keyboard Input Methods, it won't load the preferences window. It'll say "Starting..." on the taskbar but then disappear. The usual keyboard shortcut does nothing

View 4 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

General :: Data From Input File To Be Taken And Send To Output File?

Jul 24, 2010

I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:

3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---

[code]...

View 14 Replies View Related

Ubuntu Installation :: Cannot Install - Or Any Other Based Distro - Just Hangs - Still Showing The Menu Of Boot Options

Mar 11, 2011

I bought a new NVidia Asus EN210 for my HTPC, but I can't get Ubuntu to install.

First I made a live USB disk of 10.10 with Unetbootin and when I choose the option of "try Ubuntu" it starts loading and then just hangs, still showing the menu of boot options. After this I tried Xubuntu on a USB disk. This one also starts loading but then just fails. I also tried XBMC Live. This one does show the Ubuntu 10.04 screen but then just shows a black screen.

After this I found a CD with Ubuntu 10.04, I think or it is 10.10, laying around in my room. I booted it and once I select an option from the install menu it starts to load, but then just gives a black screen with a flashing "-" sign.

The strange thing is, once I pop in the old video card, which is an ATI HD4350, my Ubuntu 10.10 Live CD on USB disk does work and it does get past the menu of boot options (in my second paragraph I describe how this isn't the case with Ubuntu 10.10 combined with my NVidia card).

View 3 Replies View Related

Debian Multimedia :: Gnome Send|Move To Context Menu

Sep 24, 2010

I'm wondering if somebody knows how to add more locations to "Send to", or "Move to" menu. Now there is only Desktop and Home folder. I know there is this nautilus actions configurator app, but with it, I'm able to add to main context menu, not to "Copy|Move to" submenu.

View 2 Replies View Related

Programming :: Send File Through Raw Socket Using C Programming

Jul 23, 2010

I am currently doing a research on video transmission over wireless LAN. I tend to transmit my offline file (xx.svc) from server to client.It may sound stupid (since I have a very little knowledge about c programming and raw socket), but my biggest challenges is that when I want to write the file to the buffer, how actually to define/include the file at the programming coding? where I need to locate the file? Is it at the same folder with my c programming, or somewhere in the linuxinclude folder?

Can anyone just give a simple example on how to include a file and write it into a buffer before send it through raw socket.

View 14 Replies View Related

Programming :: Socket Programming Send File

Jun 22, 2009

this is my client and server. I can receive text file. but I can't send other type of file like PDF,Docx,Odt

View 11 Replies View Related

Programming :: Input And Output On C++ Programming ?

Jan 28, 2010

As i am new to C++ i couldn't figure out how to input a file and make some change on the file and produce a output file. like this problem i have is.

"Program that processes an input file and produces an output file. The input file will contain lines of data, each containing two floating point numbers. The lines of the output file should contain the two numbers read and their average (with a '$' sign and 2 places after the decimal point)."

View 2 Replies View Related

Programming :: Filtering Based On Columns?

Nov 13, 2010

Is there any way to filter the output of a command based on the values on the output columns. For example i execute du -h on directory with many files. Now I want to filter the output based on the size (i.e. M or G or K ). The filtered o/p should contain only M(megabytes) or G(gigabytes) and also all columns.

20K ./fload/temp/20000101/Pam
15K ./fload/temp/20000101/NAVEX
29K ./fload/temp/20000101/Avenge

[code]....

View 3 Replies View Related

Programming :: Non-GNU Based Getopts For Java?

Jul 29, 2010

I'm looking for a version of Getopts for Java that isn't licensed under the GPL and accepts long options (i.e. both -h and --help). My code is licensed under BSD and I don't really want to change that just because a module uses the GPL...

View 1 Replies View Related

Programming :: Separate Out Files Based On Name?

Apr 1, 2011

I have a folder named Pictures that contains a bunch of .jpg files. My problem is that they all have randomly numbered names, then there is a duplicate of the file that is random numbers then the letter a right before the .jpg.for example, there would be 123.jpg and 123a.jpg, where 123a.jpg is just a resized version of 123. What i'd like to do but have NO clue how to, is to have a script or something go through my Pictures folder, then copy the ones that end in a.jpg to a folder called Resized, and ones that dont have that to a folder called Originals. That way my Pictures folder will be in tact, and i'll have copies of them all separated out.I have to do this all through the CLI on a machine, maybe I dont even need a script and can just do it with a slick command?

View 14 Replies View Related

Programming :: Get Input Without The Terminal?

Apr 1, 2010

I've done a little program, it's the snake game. I use an X window to show the snake and all that but the input is taken from the terminal. That means that what I have to do to play the game is open it with the terminal and then the game opens but then I have to go to the terminal again to move the snake. if I open the game from the GUI I can't do anything because it doesn't take my directions. What do I have to do in order to get the program to have a connection with my keyboard? I use getchar() to get the input, maybe there is something else?

View 9 Replies View Related

Programming :: Get Input From Entry Using Gtk?

May 2, 2011

I'm trying to make a program to simulate a parabolic movement, so i've added 2 entries, one for the initial velocity and other for the angle, anyway you probably don't care about that xD what i want is to take the number entered in the entry and put it in a variable to do the math, and then show everything in a dialog or something. how do i do that?

View 3 Replies View Related

Programming :: API To Get Partition Name Based On File Path In C On OS?

Jul 19, 2011

Is there any API to get partition name based on file path in C on Linux OS?

View 1 Replies View Related

Programming :: Bash Script In Based Hosting?

Apr 4, 2010

i have a question in my mind.sorry if its irrelevant to this topic.Can i run bash script (which i currently run on cygwin) in linux based web hosting?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved