ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a function which acts as a job submission that is automatically sent as a background job. I would like the return of the job to represent what a user actually type in a command line but as of now it returns the literal function.
So the whole background on this is that our users kick off certain jobs and continue to work. These happen to be jobs for SAS which may take varying lengths.
so they submit a job through a command like sas program.sas and their job is submitted and they continue to do their other work.
In the process they may submit many jobs but when a job is done they are going to be prompted. The users would like to see which job finished.
so I have a function that looks similar to this
function sas () { /opt/local/bin/sas94 "$@" &}
they submit
sas program1.sas
sas program2.sas
As soon as the first program is done X minutes later they get this:
[1]+ Done /opt/local/bin/sas94 "$@"
This isnt informative of what just finished
If they were to do
sas program1.sas &
sas program2.sas &
they get assuming the first one finished, giving more meaningful information
[1]+ Done /opt/local/bin/sas94 program1.sas
So I am trying to figure out what I am missing in my function so they don't always need to add & to push a job in background and get this result.
In the past we had another environment csh where I could just do this in an alias and I would get the proper return. In bash it seems I need to get into a function to be able to pass the program parameter and im kind of stuck. Sorry I am really a SAS programmer not so much a Linux guy...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.