LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2015, 07:23 AM   #1
aavika
Member
 
Registered: Dec 2014
Posts: 82

Rep: Reputation: Disabled
convert javascript to shell script


i have a javascript code and i want to convert it into bash or shell script code to run in linux machine

document.onkeydown = function (e) {
if(e.which == 9){
return false;
}
}

thanks in advance
 
Old 04-28-2015, 07:32 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
In a shell script that context does not exist. So there is no document. Javascript is usually embedded into an environment constructed by the browser. Using a shell script there is no such environment, nothing will/can call this function, so actually converting a javascript to shell has no any meaning. But probably you need to implement a function in shell. Can you please explain what do you want to achieve?
 
Old 04-28-2015, 07:56 AM   #3
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
thank u so much for the reply
i am searching a shell script code, from which i can disable a particular keyboard key.
In the above javascript '9' is 'Tab' keycode

i have to disable Esc, arrows key, Alt and 'd'
 
Old 04-28-2015, 08:06 AM   #4
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
http://www.heckdesigns.com/tutorials...th-javascript/
 
Old 04-28-2015, 11:29 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
I see. So that is the same thread as http://www.linuxquestions.org/questi...ys-4175540975/

I cannot say anything else, you need to use loadkeys, but first you need to understand how does it work.
 
Old 04-29-2015, 03:22 AM   #6
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 806

Rep: Reputation: 186Reputation: 186
I think the correct way should be using stty and changing the (probably) undef the appropriate code.

Ok
 
Old 04-29-2015, 03:24 AM   #7
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
thank you..
i dont have /usr/share/keymaps...
what should i do to create keymap file i.e .map file??
thanks in advance
 
Old 04-29-2015, 03:35 AM   #8
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 806

Rep: Reputation: 186Reputation: 186
Did you get a satisfactory response for the exact same question in this thread?

http://www.linuxquestions.org/questi...ys-4175540975/

Ok
 
Old 04-29-2015, 03:53 AM   #9
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
no.. i didnt got it..
how to use stty? dont know anything about this
plzz help
 
Old 04-29-2015, 05:53 AM   #10
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
created .map file in /lib/udev/keymaps/check.map

contents of file: keymaps 0-2,4-6,8-9,12
keycode 58 = Alt
keycode 1 = Control

In addition i wrote in /etc/rc.d/rc.local : echo "Setting Keymap..."
loadkeys < /lib/udev/keymaps/check.map

when i run /etc/rc.d/rc.local , it gives: Setting keymap...
/lib/udev/keymaps/check.map: No such file or directory

i dont know where i am wrong.. help me please
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script, Perl script, command or utility to convert Binary to text Perseus Programming 26 07-12-2012 07:00 AM
Convert python script to shell script investmentbnker75 Programming 13 09-05-2010 02:38 AM
javascript like shell script? jpbarto Programming 5 07-31-2003 06:30 PM


All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration