Sponsored Content
Full Discussion: Handling variable inputs
Top Forums Programming Handling variable inputs Post 302198493 by yhacks on Friday 23rd of May 2008 04:42:19 AM
Old 05-23-2008
Power Handling variable inputs

Hi,

Is there any way to handle variable inputs.
If an application handles more than one input
how to print the input values.

Example :

./a.out 1 "hi" 3
./a.out 1
./a.out 1 3 4 "hello"

output should be:

1
hi
3


1


1
3
4
"hello"

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple Inputs

Have tried the search, but nothing resembles what I'd like to accomplish. I am attempting to write a script that will allow the user to input a list of data at the command prompt, then the data is used by another script for processing. I am allowing the user a list of 10 members in order to... (4 Replies)
Discussion started by: douknownam
4 Replies

2. UNIX for Dummies Questions & Answers

VARIABLE HANDLING in UNIX

Hi All, :confused: can anyone throw some light on variable handling in UNIX script?? I want to know about the local variables we declare inside the UNIX script. e.g. i=10 OR cat file1 | while read line do echo $line done etc. Does UNIX have any data types Can some one... (1 Reply)
Discussion started by: VENC22
1 Replies

3. Shell Programming and Scripting

Inputs from a file

Hi, I have a shell script that has to taken inputs from a file say "Inputs". Now I take 2 inputs at a time. Suppose the Inputs file contains numbers like 2 3 4 5 Now I have a written a script for adding 2 numbers. When I run the script for first time 2 and 3 must be the inputs. When i run the... (4 Replies)
Discussion started by: sendhil
4 Replies

4. Shell Programming and Scripting

Please give your inputs !!!!

I am trying to extract two fields from the output of ifconfig command on one of my sun server . The output looks like : root@e08k18:/tmp/test# ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 ce0:... (9 Replies)
Discussion started by: kpatel786
9 Replies

5. Shell Programming and Scripting

How to read inputs from a file

Hello; Please I need to read inputs from a file change 1 or 2 things the output to another file. (1 Reply)
Discussion started by: jimoney
1 Replies

6. Shell Programming and Scripting

Read variable inputs

I am trying to make an interactive script. Only problem my inputs are not read and correctly channeled. Please help: Here is my code #!/bin/sh PATHSCRIPT=/home/pp/tmp #if ; then # echo "Syntax : $0 input off lat sample" # exit 1 # fi echo "Choice of Graph" echo "1 -- Type... (5 Replies)
Discussion started by: newkid.7955
5 Replies

7. Shell Programming and Scripting

Taking inputs on prompt

need a help to get a script: bash # ./xx.sh >> count 567 script will run the xx.sh and it will go to >> then run "count" will get the result "567" and print it (7 Replies)
Discussion started by: Aditya.Gurgaon
7 Replies

8. Shell Programming and Scripting

Taking inputs for awk

Hi, i want to print 2nd column value with the below script. I need to take input of the string i need to search in that file and file name. How can i take these two as inputs? using read command? Getting error for below script. echo "enter SID" read SID echo "enter filename" read filename... (8 Replies)
Discussion started by: sam_bd
8 Replies

9. Shell Programming and Scripting

How to bring together two inputs in case?

Hi guys, im newbie, im trying something, but cannot figure out how to bring together case with 2 inputs. Something like "enter your name" and "enter your age". I had idea but dont now how to finish it as I said i'm just a beginner. #!/bin/bash echo "Name" echo -n "Enter your name: "... (2 Replies)
Discussion started by: PrincMehi
2 Replies

10. Shell Programming and Scripting

Inputs argument for sh -c

I have doubts with the following command: % find "$1" -name "*.html" -print0 | sort -zn | xargs -r -0 -n 1 sh -c 'echo "Dumping file: $2" >> "$1"; w3m "$2" >> "$1" 2>&1 ' sh "$2" I have doubts in the input arguments value i.e. $0, $1, $2... Step by step: 1.- % find "$1" -name "*.html"... (10 Replies)
Discussion started by: puertas12
10 Replies
CMPCI(4)						   BSD Kernel Interfaces Manual 						  CMPCI(4)

NAME
cmpci -- C-Media CMI8x38 audio device driver SYNOPSIS
cmpci* at pci? dev ? function ? audio* at audiobus? mpu* at cmpci? opl* at cmpci? flags 1 DESCRIPTION
The cmpci device driver supports C-Media CMI8x38 based sound cards. The device has SPDIF input/output interfaces, 16bit CODEC with analog mixer, OPL3 FM Synthesizer, and MPU401 compatible MIDI I/O port inter- face. MIXER DEVICE
The mixer device of cmpci driver can be accessed via mixerctl(1) command. The complex structure is analyzed as follows. SPDIF in ---------------------- #1(coax)->|spdin1 | R ----------------------- #2(opt)-->|spdin2 spdif.input |--*->--|spdin spdif.output |--> SPDIF -->|spdout | | -->|playback | output | ---------------------- | | ----------------------- --------------------<------+-* ---------<-------------------+-+---------------------------------- | ------------------------ | | ----------------------- | -->|legacy spdif.output. |--+-*-->|spdout | | -->|wave playback | ----->|spdin spdif.monitor |---- | | ------------------------ NC-|off | | | ---------<-- spdif ----------------------- | | -------+------- dac ------------ ----------------- v | wave -->|playback.mode|---->|inputs.dac|-*->|inputs.dac.mute|->----- | playback --------------- ------------ R ----------------- | + | | ----------------- --------------------- |mix| | FM synthesizer -->|inputs.fmsynth |--*->|inputs.fmsynth.mute|-->----- | ----------------- R --------------------- *->-- CD ---------------------- --------------------------- v LINE-IN ->|inputs.{cd,line,aux}|-*>|inputs.{cd,line,aux}.mute|->----- AUX ---------------------- R --------------------------- | | ------------------ | | PC-SPK -->| inputs.speaker |----------------------------------->| + | ------------------ | | ------------------- ------------ ----------------- |mix| MIC --*-->|inputs.mic.preamp|->|inputs.mic|->|inputs.mic.mute|->| | | ------------------- ------------ ----------------- ----- | ------------ ----------------- | --->|record.mic|-->| | v ------------ | record.source |-->to ----------- *R-->| (select, mix) | recording |outputs.*|--> ----------------- ----------- SPK (front) Note the 2nd SPDIF input exists only on CMI8738/PCI-6ch versions. MIXER EXAMPLES
Here are examples about wave playback and SPDIF input/output ports. Playback to speaker, SPDIF input to SPDIF output mixerctl -w playback.mode=dac spdif.output=spdin spdif.monitor=off Playback to SPDIF output, SPDIF input to speaker mixerctl -w playback.mode=spdif spdif.output=playback spdif.output.playback=wave spdif.monitor=spdin SPDIF input to both SPDIF output and speaker mixerctl -w spdif.output=spdin spdif.monitor=spdin Playback to both SPDIF output and speaker mixerctl -w playback.mode=spdif spdif.output=playback spdif.output.playback=wave spdif.monitor=spdout Mix playback and SPDIF input to speaker mixerctl -w playback.mode=dac spdif.monitor=spdin SEE ALSO
mixerctl(1), audio(4), midi(4), mpu(4), opl(4), pci(4) HISTORY
The cmpci device driver appeared in NetBSD 1.5. BUGS
4ch/6ch playback is not yet available. Joystick port is not supported. spdif.output.playback=legacy does not seem to work properly. BSD
June 22, 2005 BSD
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy