Unix script rm behaiving differently in difference machine
Hi All
The below is the script, if i supply the script with the argument -f then it will delete the tmp file . We are having 3 unix system out of that two system are processing this file only one system is not processing and the error showin is below the script ..
can you please help me
#! /bin/ksh
if [ $# -eq 0 ]
then
Echo " Usage incorrect"
fi
if [ "$1" = "-f" ]
then
print "Home Dir : ${HOMEDIR} Unix User : ${UNXUSER}"
rm -f ~/clean_tmp_* 2> /dev/null
fi
.......
Home Dir : /pps Unix User : pct
/pps/clean_tmp_cmd[2]: +390: not found
^[&dE Error in file find/delete ^[&d@
{} not found
; not found
^[&dE Error in file find/delete ^[&d@
Will remove files called clean_tmp_* from the user running the scripts home directory, hence:
Quote:
/pps/clean_tmp_cmd
rather than the expected:
${HOME} is the standard variable for a user's home directory, don't know where ${HOMEDIR} comes from?
${LOGNAME} or ${USER} are the normal variables holding the username, don't know where ${UNXUSER} comes from?
If /pps is really the intended directory it would be interesting to see the output from:
because it looks like you "might" have some non-Unix compliant file names in there.
I'd also like to see what the user pct home directory is set to in /etc/passwd?
Hi, awk seem to be acting differently in Unix and Linux when it comes to formatting. This is making it difficult to migrate scripts.
for example:
UNIX:
echo "123" |awk '{printf ("%05s\n" ,$1)}'
00123
echo "123" |awk '{printf ("%05d\n" ,$1)}'
00123
echo "S12" |awk '{printf ("%05s\n"... (9 Replies)
There are 2 dates,
Tue Oct 1 13:40:19 2013
Sun Sept 30 10:26:23 2013
I have multiple dates like the above one. How do I calculate the date time difference and display in another column in Shell script. Please help. (3 Replies)
Hi All..
Am new to Unix!!
Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp).
And also i have to transfer the input file from the local directory to Unix machine (Server)
Any help from you... (1 Reply)
Guys i have strange behaviour with command output being saved in a variable instead of a tmp file.
1. I suck command output into a variable
Sample command output
# cleanstats
DRIVE INFO:
----------
Drv Type Mount Time Frequency Last Cleaned Comment
*** ****... (1 Reply)
i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
I would like to find whether a file exists in the UNIX machine. That i can check using
if ;then
echo "exists"
echo " `cat $file` "
else
echo "invalid file"
fi.
and i can find out using :
find / -name "filename" . But it i have wanted to search in all directories. How to get... (3 Replies)
Hi
i need to FTP files from windows to unix(sun) machine using script. what are the scripts commands i need to use to transfer files
Thanks (2 Replies)
All,
I have a script that runs on 2 servers and there seems to be something wrong. It's producing different results on the 2 servers.
Here is the script on server1 which is behaving correctly but on 2 behaving differently.
2nd server:
I couldn't make out whats the error is?... (5 Replies)
Hi,
I wrote a script to stop a process,truncate its log files and re-start the process...
We are using Progress Software in Unix ( Sun Sparc)
When ever I start this progress program , it should kick off a C pgm in the background..
The script work perfectly fine when I run it from command... (4 Replies)
I posted this in Shell scripting... maybe I'll try it in this forum..
*****************
I wrote a script to stop a process,truncate its log files and re-start the process...
We are using Progress Software in Unix ( Sun Sparc)
When ever I start this progress program , it should kick off a... (1 Reply)