![]() |
|
|||
![]()
How do I create a shell script that run the following command.?
Code:
mplayer -playlist r1live.ram |
|
|||
![]() Quote:
|
|
||||
![]()
If the script is not being executed from the same directory as the r1live.ram file, you might want to put an explicit path.
Code:
mplayer -playlist ~/Music/Playlists/r1live.ram or where ever you put the playlist. This is especially useful if you intend to use this script as part of some kind of menu/dock or desktop shortcut.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]() Quote:
Using an alias won't spawn an instance of sh, using a script does ... But what I mainly meant was that it's faster/easier to set up and maintain, especially if you have lots of little shortcuts like this ... This is how I prefer to do things.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]()
From FreeBSDs manual on /bin/sh
Quote:
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
![]()
What is alias? I need to paste the code into a file ? And chmod +x ?
|
|
||||
![]()
Nope, the % indicates its a command.
Actually, the correct command is % alias mp='mplayer -playlist r1live.ram' The above alias is valid in the current shell session only. You might wanna put it in the shell startup script so that the alias will be set in every new shell session |
|
|||
![]()
I see.
I have another question. Can I write a GUI shell program (like a calculator program) ? |
|
||||
![]() Quote:
Quote:
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
![]()
Besides shell script, is there other programming language that run GUI in OpenBSD like C, java...etc ?
|
|
|||
![]() Quote:
|
|
||||
![]()
I believe the Korn Shell has some form of access to a GUI toolkit but have never actually looked into it.
Beyond scriptable interfaces like dialog/kdialog and whatever else is out there (which can create portability nightmares for scripts) a general purpose programming language and GUI toolkit is usually best for doing non-trival work. If your not familiar with GUI toolkits, I'd suggest Qt -- it is well documented (in C++) and has bindings to many languages. PyQt (Python bindings to Qt) also makes things very painles to use/learn if you know enough C++ to follow the Qt documentation. If your familiar with either language, Javas Swing and just about all of Pythons bindings to toolkits are probably good choices as well. You could probably do a GUI application on OpenBSD in Assembly if you wanted to get jigy with it.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
![]()
Why hasn't anyone mentioned the curses library?
![]() |
|
|||
![]()
It's a GUI according to my books, "Graphical User Interface", while it might just be a clever use of escape codes... looks pretty graphical too me.
|
|
|||
![]()
Fuck tradition, I can think for my self, it's a GUI.
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
shell script with zenity | bsdnewbie999 | OpenBSD General | 5 | 24th April 2009 02:37 AM |
shell script-start another process | bsdnewbie999 | Programming | 2 | 23rd April 2009 07:48 PM |
shell script compare md5 sum | bsdnewbie999 | Programming | 1 | 11th April 2009 02:20 PM |
incrementing within a shell script? | spiderpig | Programming | 5 | 29th September 2008 08:12 PM |
shell script with input | c0mrade | Programming | 5 | 13th July 2008 04:33 AM |