Sponsored Content
Top Forums Shell Programming and Scripting For x in a b c; { list; } (in lieu of do list; done) works (in bash) - why and how? Post 302765989 by neutronscott on Monday 4th of February 2013 03:31:13 AM
Old 02-04-2013
how about f() without braces?

Code:
mute@clt:~$ f() for x in 1 2 3; { echo $x; };
mute@clt:~$ f
1
2
3

implementation. somehow for got away with accepting a list, but while didn't. I would not rely on it, but it has saved me a few bytes with code golfing Smilie
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[bash]Stripping lines from a list

Hello! I have a script that is (among other things) doing the following: list=/tmp/list1.txt ncftpls -u <user> -p <password> -x "-l1" server.domain.tld > $list cat $list | nl echo "Choose file: " read file cat /tmp/list1.txt | nl | grep $file | sed -e "s/$file//g" -e "s/ //g" | column -t... (8 Replies)
Discussion started by: noratx
8 Replies

2. Shell Programming and Scripting

Make a list in bash out of arguments

Hello, I have a very stupid/simple problem, but for some reason I cannot figure out...and I need your help! I am writting a bash scrip that should be executed using "my_script X Y Z T" where X Y Z and T can be any string, but there can be any number of arguments. I want my script to do... (4 Replies)
Discussion started by: jolecanard
4 Replies

3. Shell Programming and Scripting

Splitting a list @list by space delimiter so i can access it by using $list[0 ..1..2]

EDIT : This is for perl @data2 = grep(/$data/, @list_now); This gives me @data2 as Printing data2 11 testzone1 running /zones/testzone1 ***-*****-****-*****-***** native shared But I really cant access data2 by its individual elements. $data2 is the entire list, while $data,2,3...... (1 Reply)
Discussion started by: shriyer
1 Replies

4. Shell Programming and Scripting

How to find the X highest values in a list depending on the values of another list with bash/awk?

Hi everyone, This is an exemple of inpout.txt file (a "," delimited text file which can be open as csv file): ID, Code, Value, Store SP|01, AABBCDE, 15, 3 SP|01, AABBCDE, 14, 2 SP|01, AABBCDF, 13, 2 SP|01, AABBCDE, 16, 3 SP|02, AABBCED, 15, 2 SP|01, AABBCDF, 12, 3 SP|01, AABBCDD,... (1 Reply)
Discussion started by: jeremy589
1 Replies

5. UNIX for Advanced & Expert Users

Bash-Completion, one list shown, the other not.

Heyas I'm trying to read out a file which contains a variable and use that list to complete a bash command. Difficult part on this is, that 2 (actualy 3) different lists are to be used, but the 'dynamic' ones from the external file dont work properly. It only seems to work with the list... (2 Replies)
Discussion started by: sea
2 Replies

6. Shell Programming and Scripting

Bash compare a list of file

Dear all, I believe this is a Bash basic question... I am bit ashamed for asking actually... I want to create a Bash script that compares 2 different folders: 1) work_folder and 2) work_folder.git #!/bin/bash FOLDER_NAME=`pwd | awk -F/ '{ print $NF }' | awk -F. '{ print $1 }'` ... (6 Replies)
Discussion started by: freddie50
6 Replies

7. Shell Programming and Scripting

Bash to list all folders in a specific directory

The below bash is trying to list the folders in a specific directory. It seems close but adds the path to the filename, which basename could strip off I think, but not sure why it writes the text file created? This list of folders in the directory will be used later, but needs to only be the... (5 Replies)
Discussion started by: cmccabe
5 Replies

8. Shell Programming and Scripting

Bash - re-ordering list of parameters

Hello. I have a script that writes parameters in alphabetic order. But I have a parameter which have 3 lines. There is no continuation character ( '\' ). Each of the three lines finish with 'cr'. But line 2 and 3 of the concerning parameter start with a tab char (but should be one or more... (7 Replies)
Discussion started by: jcdole
7 Replies
ossmix(1)							 OSS User Commands							 ossmix(1)

NAME
ossmix - Open Sound System command-line mixer program. SYNOPSIS
ossmix [-d <dev#>] [-achqD] [control name] [value] DESCRIPTION
ossmix is a simple command-line mixer utility that is used to display the mixer settings of physical and virtual audio devices. OSS version 4 has an extended mixer API which supports some device specific features that may not available using other mixer applications. OPTIONS
-D Display device information. -a Dump mixer settings for all mixers (normal format). -c Dump mixer settings for all mixers (command format). -h Display usage information. -q Quiet mode. -v[1|2] Verbose mode. -v2 prints more detailed infoamation than -v1. ctrl# value Change value of a mixer control. <no arg> Display current/possible settings. USAGE
ossmix without any arguments displays the current settings of the default mixer device (usually the motherboard sound chip). This printout can also be used to find out the supported control names and their possible values. Currently all controls accept an ON/OFF value, a mono value (0 to 100) or a stereo value (left:right where both channel volumes can be between 0 and 100). The value can also be expressed in a relative form (e.g. +1 to add 1 to the previous volume). An ON/OFF control can also receive a TOGGLE value. If a control has a name in quotes following the normal output, than the name can be used instead of the control when setting a value. The following is a sample printout produced by ossmix: Selected mixer 0/Creative AudioPCI Known controls are: vol <both/leftvol>[:<rightvol>] (currently 50:50) pcm <both/leftvol>[:<rightvol>] (currently 50:50) speaker <monovol> (currently 21) line <both/leftvol>[:<rightvol>] (currently 32:32) line.rec ON|OFF (currently OFF) mic <monovol> (currently 16) mic.rec ON|OFF (currently ON) cd <both/leftvol>[:<rightvol>] (currently 100:100) cd.rec ON|OFF (currently OFF) pcm2 <both/leftvol>[:<rightvol>] (currently 75:75) line1 <both/leftvol>[:<rightvol>] (currently 32:32) line1.rec ON|OFF (currently OFF) line2 <monovol> (currently 32) line2.rec ON|OFF (currently OFF) line3 <monovol> (currently 0) line3.rec ON|OFF (currently OFF) mic.micboost ON|OFF (currently ON) mic.micbias ON|OFF (currently ON) mute.pcmmute ON|OFF (currently OFF) mute.pcm2mute ON|OFF (currently OFF) mute.micmute ON|OFF (currently OFF) mute.cdmute ON|OFF (currently OFF) mute.linemute ON|OFF (currently OFF) mute.line1mute ON|OFF (currently OFF) mute.line2mute ON|OFF (currently OFF) mute.line3mute ON|OFF (currently OFF) SELECTING MIXER DEVICE
It's possible to select the mixer device by using the -d<mixernumber> command line argument. This argument (when used) should be the first one on the command line. By default the mixer number 0 will be accessed. To find the available mixer devices, type ossinfo -x and look under the Mixers heading for available mixer devices. CHANGING MIXER SETTINGS
Changing the values is done just like with the original "mixer" applet. For example: ossmix pcm 50:60 The above sets the pcm control (audio playback volume) so that the left channel volume is 50 and the right channel volume is 60. With just "ossmix pcm 50" the both channel volumes will be set to 50. In addition to the old mixer there are now some (usually ON/OFF) settings. These settings are device specific and don't work with all soundcards. The easiest way to find them out is to start ossmix without command line arguments (other than -d#). Some control names contain a dot ("."). This dot is required when changing the value. For example: "ossmix -d0 mic.micboost ON". EXAMPLES
ossmix vol 50 Set the vol control volume to 50. If the pcm control is a stereo control, than both channels will be set to 50. ossmix vol 50:60 Set the vol control so that the left channel volume is 50 and the right channel volume is 60. ossmix vol +2 Raise vol volume by 2. ossmix -- vol +2:-2 Raise the left channel volume by 2, and lower right channel volume by 2. The "--" is needed on some systems so that the "-2" won't be mistaken for a parameter. ossmix micboost ON Set micboost to ON. ossmix micboost TOGGLE Toggle micboost. ossmix mplayer +2 Raise mplayer volume by 2. This would only work if mplayer is using the virtual mixer. FILES
/usr/bin/ossmix SEE ALSO
ossdevlinks(1), ossxmix(1), savemixer(1) AUTHOR
4Front Technologies 16 December 2012 ossmix(1)
All times are GMT -4. The time now is 10:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy