Note that there are some explanatory texts on larger screens.

plurals
  1. USmklement0
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. CORe field vs. column: To me, 'column X' implies 'character at position X', not 'the Xth separator-based field (token)', and in general I would caution against using 'column' and 'field' synonymously. That said, your answer and my comment now have both cases covered, so hopefully everyone will find what they need. Re variable passing: agreed. (I just wanted to keep my solution short.) One final comment: Your solution uses `awk`'s default field separator - white space - which is an assumption that should be stated.
      singulars
    2. COJust to piece it all together (assuming that 'column X' means the Xth character on the line): `awk -v FS='' 'NR >= 5 && NR <= 5 + '$Y' { print $'$X' }' file.txt`. Note that the shell variables are spliced directly into the awk statement. Also note, curiously, that (at least on OS X 10.8.1) you cannot specify an _empty_ field separator via the -F option - hence the definition via `-v`.
      singulars
    3. COWhile I don't see any technical problem with the script in your question (it should output whatever `node` outputs), I don't see an advantage over simply calling `node` _directly_ with the *.js file as the argument. As to the larger question of changing what the various GUI file managers do when opening a *.js, I suspect there is no generic answer. There's a generic _Ubuntu_ answer [here](http://askubuntu.com/questions/4361/how-are-file-extensions-mime-types-icons-default-applications-asssociated?rq=1), but you'll have to figure out how to specify a shell command/script as an application.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload