Sponsored Content
Top Forums Shell Programming and Scripting Script Variables Inquiry, Values Okay in Standalone Exec, No-Show in Cron Exec Post 302659829 by ginowms on Thursday 21st of June 2012 12:40:06 PM
Old 06-21-2012
Turns out that a slight adjustment was required. After setting the PATH and sourcing /etc/profile, I culled through some other scripts to see how ls was used. Turns out I had to prefix the ls and tail with /usr/local/bin/.

Code:
#!/bin/bash
#
# Write Date to cron.log
#
echo "Begin SSI Load $(date +%d%b%y_%T)"
#
# Get the latest rates file for processing.
#
cd /rms/ssi/data
d=$(/usr/local/bin/ls -tr *.csv | /usr/local/bin/tail -n 1)
filename=$d
export filename
echo "The file name is $filename."

This puzzle solved, until the next one. Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

difference between source, exec and ./script

What is the difference between sourcing a script, running it or execing it? (1 Reply)
Discussion started by: 98_1LE
1 Replies

2. Shell Programming and Scripting

Multiple exec command s in a script

Hi everyone, I've been racking my brains for ages on this and need your help/advice. I am writing a script that is reading in file to process and putting them into a temporary file. The loop starts and the script gets the first file name, does what i needs to do (copy it) and then returns to... (2 Replies)
Discussion started by: Angoss
2 Replies

3. Shell Programming and Scripting

using -exec in a script

I am using a third party job management program called Autosys. the command to load a jil into the autosys database is jil < somefilename.jil I have a directory and it in are a lot of jils. rather than type jil < somefilename.jil for every file I would like to script something do do it. if cd... (2 Replies)
Discussion started by: jayjabour
2 Replies

4. Shell Programming and Scripting

Perl variables in exec or system

I am new in Perl. I am working in simple script and the varibles are working well outside the exec or system command. but they don't work as parameters to exec or system command. The script is attached. please help. (8 Replies)
Discussion started by: ahmed_zaher
8 Replies

5. Shell Programming and Scripting

stdout redirect is working buy direct script exec but not in cron

Hi @ all :) i made a very little shell script witch is working well when i'm launching it directly like with ./script but when i'm launching it by cron tab it work at half only. the part of the script witch are not working are: #!/bin/sh apt-get updade apt-get -s upgrade >>... (5 Replies)
Discussion started by: calibal
5 Replies

6. Shell Programming and Scripting

-exec cmd in ksh script

Hi, I discovered the following single-line script works very well to cp a large number of files from a source directory to a destination directory while avoiding the "argument list too large" error: # cpmany - copy large number of files # Takes two parameters - source dir, destination dir... (14 Replies)
Discussion started by: Tanuka
14 Replies

7. Shell Programming and Scripting

exec script error

Hi, Gurus, my script code as following: #!/usr/bin/sh mkdir dir1 result=`echo $?` if ; then echo "completed" else echo "wrong" fi When I execute it with command sh filename. , it executed successfully. but, when I execute it with command . filename it throw out error: -bash:ELF :... (2 Replies)
Discussion started by: ken002
2 Replies

8. UNIX for Dummies Questions & Answers

while read and exec based on values

hi i need a ksh to read file and depending on value do something. can anyone help? thanks (3 Replies)
Discussion started by: chamajid
3 Replies

9. Shell Programming and Scripting

Use of exec command in a script

Guru's, I want to make a use of "exec" command in my script and want to check return code of executing script, but as you know exec command will terminate current processID and comeout and will trigger new one, i am unable to check return code of script and not able to run a scrpit after exec. ... (2 Replies)
Discussion started by: pawar.atul28
2 Replies

10. UNIX for Beginners Questions & Answers

Question about global environment variables & fork() exec()

Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy