10-16-2008
Set a variable that changes every time?
Do not know how to do this, any help would be appreciated:
I have a file that comes in called xxxx.txt. I have a script that does some messing around with the file.
The file needs to go out as PAB108XXXX.csv
The four x's above will be a number that changes everytime the script is ran e.g.
1st run
PAB1081234.CSV
2nd run
PAB1081235.CSV
I need it to increase by one everytime? can this be set in a variable that will increase by one everytime?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
hi,
I have one environment variable like path in my system.But in my program i need to change that path .suppose it has a value "config" now i need to chage it as "config1" or something else.i need to use that variable for complete project.It means at first it will use the old path but after... (4 Replies)
Discussion started by: sada@123
4 Replies
2. UNIX for Dummies Questions & Answers
I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so:
set -a
export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data"
export... (2 Replies)
Discussion started by: ParNone
2 Replies
3. UNIX for Advanced & Expert Users
Hi,
I have 4 solaris 9(32-Bit) Sparc machines on the same subnet.
All 4 of them have different times( off by 10-15 mins).
I need to synchronize all 4 of them.
Please advise what I should do to sync them to the proper time, and with each other.
Thanks (3 Replies)
Discussion started by: 0ktalmagik
3 Replies
4. Shell Programming and Scripting
okay, this shouldn't be difficult but I can't figure it out. How can I set a variable with another variable. I have the following:
foreach pe ($dir $sp)
set tpe = `echo $pe | grep M`
if ($tpe == M) then
set ${$pe} = M <--- This doesn't work
else
endif
end
In this case what... (2 Replies)
Discussion started by: wxornot
2 Replies
5. Shell Programming and Scripting
Hello Folks,
I have been asked to write a test script which can be run by students. the script should have a time limit.
I have almost completed it except the bit of timing!
I've seen something like this:
on_timeout()
{
echo "$USER $score " >> theresult.txt
echo "Time out!... (2 Replies)
Discussion started by: SultanKSA
2 Replies
6. UNIX for Dummies Questions & Answers
Hi everybody...
I am using IBM unix server . Server take time options from satellite but server is not include true setting . What can I do? (2 Replies)
Discussion started by: deox
2 Replies
7. UNIX for Dummies Questions & Answers
Currently whenever i run date command output is shown like
Mon Apr 12 05:17:21 IST 2010
When its 17:17 Here.
How would i change it so that it should show.
Mon Apr 12 17:17:21 IST 2010 (8 Replies)
Discussion started by: pinga123
8 Replies
8. Shell Programming and Scripting
Hi,
I want to set cron job for different time zone from my machine. So here is what I did to set it.
I am having a file cronfile, which I use to set cron jobs by using
Crontab cronfile
Now in cronfile I set TZ variable as
Set TZ=Asia/Calcutta
But now... (3 Replies)
Discussion started by: sarbjit
3 Replies
9. HP-UX
Hi,
I am using hp unix
i want to know the use of the following commands
set --
set - variable
thanks (4 Replies)
Discussion started by: gomathi
4 Replies
10. Shell Programming and Scripting
Hi,
I am preparing a perl script, which will run some commads on remote Linux servers.
I have a file contains all the servers names one by one like below
vi servers.txt
srv1
srv2
srv3
Now, I need to prepare a perl script to ssh (or)rsh to each server in the above... (1 Reply)
Discussion started by: kumar85shiv
1 Replies
LEARN ABOUT OPENSOLARIS
times
times(1) User Commands times(1)
NAME
times - shell built-in function to report time usages of the current shell
SYNOPSIS
sh
times
ksh
times
DESCRIPTION
sh
Print the accumulated user and system times for processes run from the shell.
ksh
Print the accumulated user and system times for the shell and for processes run from the shell.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a
variable assignment. This means that tilde substitution is performed after the = sign and word splitting and file name genera-
tion are not performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
ksh(1), sh(1), time(1), attributes(5)
SunOS 5.11 15 Apr 1994 times(1)