You are not logged in.

#1 2014-10-12 18:07:25

bl0ndynek
Member
From: Poland
Registered: 2008-07-04
Posts: 73

Bash question

Hi,

I have question about two lines from https://wiki.archlinux.org/index.php/Acpid

 
echo $(($(< $bl_dev/brightness) - $step)) >$bl_dev/brightness

I have question about this part

$($(<

why it is like that?

Offline

#2 2014-10-12 18:40:04

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Bash question

"< file" is input redirection and works somewhat similarly to "cat file". $() executes the command and returns its output. $(()) can be used for counting.

Offline

#3 2014-10-12 19:31:30

bl0ndynek
Member
From: Poland
Registered: 2008-07-04
Posts: 73

Re: Bash question

Thank you now it's clear.

Offline

#4 2014-10-12 19:33:08

Awebb
Member
Registered: 2010-05-06
Posts: 6,298

Re: Bash question

You might want to have a look at the guides at tldp.org.

Offline

#5 2014-10-12 19:38:57

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Bash question

Awebb wrote:

You might want to have a look at the guides at http://mywiki.wooledge.org/

FTFY.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2014-10-12 19:56:54

Awebb
Member
Registered: 2010-05-06
Posts: 6,298

Re: Bash question

Indeed! If one does not have the information, the other will!

Offline

Board footer

Powered by FluxBB