Link to home
Start Free TrialLog in
Avatar of aruku
aruku

asked on

kron Scripting

Hi  I need to check if a file exists or not in a directory and then I have a file in one directory as sample. I need to move it to other directory with name sample_3355. The last data of sample.

Then I will execute the script and pu

sample
12345
23
3355

please help
Avatar of Tintin
Tintin

Something like
#!/bin/ksh
cd /path/to/dir

if [ -f sample ]
then
   newdir=sample_$(tail -1 sample)
   mkdir $newdir
   mv sample $newdir
fi

Open in new window

Avatar of aruku

ASKER

can you please help me as if

the file is in /apps/dataapps/ghgjj
and it need to transfer to /apps/ffgjr/fhdjd
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial