Running a program manual vs script

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Running a program manual vs script
# 1  
Old 05-11-2018
Running a program manual vs script

Hello -

I am new to unix... very new. I am running a program at the command prompt:-
Code:
nohup ./ledger - comptroller_extract 05/11/2018 &

The above runs as expected.

If I put it in a sh script:-
Code:
current_date=$(date+%m/%d%y)
nohup ./ledger - comptroller_extract $current_date &


This does not work. It is as if the date is ignored.

Last edited by rbatte1; 05-14-2018 at 08:36 AM.. Reason: Added CODE tags
# 2  
Old 05-11-2018
Code:
current_date=$(date +%m/%d/%Y)

(include space before plus and upper case Y for 4 digit year)
This User Gave Thanks to rdrtx1 For This Post:
# 3  
Old 05-11-2018
are u saying the Uppercase Y should be lower case >

---------- Post updated at 09:43 AM ---------- Previous update was at 09:19 AM ----------

Thank you so much!!! It is working!!!!!
This User Gave Thanks to MSpeare For This Post:
# 4  
Old 05-11-2018
You were also missing a slash (i.e. /) before the %Y in you date format string (as in +%m/%d/%Y), but I assume you have already fixed that if it is working for you now.
# 5  
Old 05-13-2018
Thank you for your help.
I created a cron entry on the user and it is working.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hundreds of files need manual preparation. Does shell script could do it automatically?

Hello friends, I have hundreds files in hand, which need extract some data from logs and read these data into an input file. Here I will explain in detail using these two files as attached. read some data from .log file and write it into the .in file. **explanation is given inside two... (9 Replies)
Discussion started by: liuzhencc
9 Replies

2. UNIX for Dummies Questions & Answers

Running a C/C++ program and/or bash script from a server

I wish to be able to give to a client the opportunity to : 0) Turn one of my ubuntu computers into a webserver 1) See a webpage after visiting a url where an external user/client can set a couple of variables (e.g. Number1= ?, Number2=?) 2) By pressing "run" the program runs on my machine 3)... (1 Reply)
Discussion started by: frad
1 Replies

3. Shell Programming and Scripting

on manual script need to add logfile

hi all, 1.I am new to linux shell scripting. 2.i had an rman.sh script which will take backup all database using CATALOG DATABASE. 3.While executing that script my catalog DB gets shutdown. 4.The rman.sh script are executed manually. 5.so i need log for rman.sh .And also it is very useful... (1 Reply)
Discussion started by: jp_linux
1 Replies

4. Shell Programming and Scripting

Manual input using script

hello, I have one script A that requires to to press "q" manually to quit the script. I am calling script A in another script B. Is there any way by which this "giving q manually" can be done inside script. and it does not require to gve it manually when using script B. Thanks. (8 Replies)
Discussion started by: skhichi
8 Replies

5. Shell Programming and Scripting

bash script to check if a program is running

I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
Discussion started by: mcknz
3 Replies

6. Shell Programming and Scripting

Problem running a program/script in the background from a script

Hi all, I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies

7. UNIX for Dummies Questions & Answers

Manual run a script on UNIX

Hi,I'm currently working on an dev environment that has no jobs to run the scripts.How can I manual run the scripts. on Unix? ---------- Post updated at 05:45 AM ---------- Previous update was at 05:43 AM ---------- Is it something like this.... ../int/inbound>./filename.sh inputfilename ... (5 Replies)
Discussion started by: sonja
5 Replies

8. Shell Programming and Scripting

Kill shell script when host program not running/disk unmounted

I have my Mac OS X program executing a shell script (a script that copies files to a drive). I want to make it so that the shell script automatically kills itself if it finds that the host .app is not running OR kill itself if the drive that it is copying files to has been unmounted. Right now what... (2 Replies)
Discussion started by: pcwiz
2 Replies

9. Shell Programming and Scripting

Leaving Program running but killing the script

Sorry for all the threads. I am almost done. I ahve a bash script that is launching a diags program then copying the .html over my client. then it does the following line /opt/firefox/firefox report.html it launches it fines but the program waits for me to close the window or kill the script.... (2 Replies)
Discussion started by: deaconf19
2 Replies

10. Shell Programming and Scripting

script execute by cron problem, but manual ok

Hi; I'm facing the problem with my script like below 30 0 * * * /data/SCRIPT/LOADLOGS/loadata1.sh 2 1 >> /tmp/loaddata.txt loadata1.sh calling a another 2 scripts which we need to exe in sequence. when it perform by cron jon, sometimes it just can process 20 recs or less or nothing but... (6 Replies)
Discussion started by: izai
6 Replies
Login or Register to Ask a Question