Microsoft
Software
Hardware
Network
Question : How to force user to place 'ksh' before running a shell script
Here is the issue, I have written a ksh script that is to be run both Unix and Linux, since the script containts logic and features that only "korn" will give better/valid result, so what I want is:
whenever this program is excuted, make sure it will be running like below:
$ ksh myprog.sh
if user enter $ sh myprogram.sh
the program will prompt the use to enter "ksh myprogram.sh" instead.
Why I am asking for this, so I don't need to care wheather the default shell for a give user is a bash/csh/
What I want is logic in "myprogram.sh" to check if user does enetr the ksh before the $0 !
Thank you,
David
Answer : How to force user to place 'ksh' before running a shell script
Change
ksh=$(set | grep ksh)
to
ksh=`set | grep ksh`
Random Solutions
Create self-extracting installer from 3 pre-existing windows MSI files
Looking for a script to update Adobe Flash on a Windows PC
Creating a query to list all dates between a starting and ending date
excel- macro for disabling and enabling the form controls
PSTN Signaling
Access 2007 query results different than vba sql results
migrated to windows2008 sbs from 2003 sbs, need to know where to place batch/script files at
Exchange Mailbox behaviour on Disabled accounts
Windows 7 Disable the Navigation pane using GP
I have a switch statement to compare a datagrid column type to a constant. How do I assign a DateTime type to a constant. I tried using type of but that is run time