Running a script in a sub dir with space in it


 
Thread Tools Search this Thread
Operating Systems Solaris Running a script in a sub dir with space in it
# 1  
Old 09-16-2014
Running a script in a sub dir with space in it

Hi

I am trying to run a script in a sub-directory, that has one space on it: such as:
Code:
/internaldisk1/Task Logs1

, but my entry in cron is not working:
Code:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /internaldisk1/Task\ logs1/./remov_reject.sh > /var/tmp/interd_`date '+%Y%M%d'`.log 2>&1

Please can you correct me if I am wrong?
# 2  
Old 09-16-2014
have you tried
Code:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /internaldisk1/Task*logs1

PS: I havent tested it....
# 3  
Old 09-16-2014
Have you tried ?
Code:
/internaldisk1/Task*Logs1

or
Code:
/internaldisk1/Task" "Logs1

# 4  
Old 09-16-2014
Not sure I like the sight of wild cards in something like that .. Smilie

what if the folder:

Task_old_Logs1

gets created?

I tested on my system (Solaris) - and this works - any reason why you just don't wrap the whole thing in double quotes ?? [edit] or is that not something cron likes ?? [\edit]

Code:
 
>  /usr/ditto/work/temp/temp > ls -ltr
total 0
drwxr-x---   2 ditto    xxxx         96 Sep 16 09:57 test folder
>  /usr/ditto/work/temp/temp > ls -ltr test*
total 2
-rw-r-----   1 ditto    xxxx         16 Sep 16 09:57 test.sh
>  /usr/ditto/work/temp/temp > more test*/*
echo "It ran!"
>  /usr/ditto/work/temp/temp > ksh "./test folder/test.sh"
It ran!
>  /usr/ditto/work/temp/temp > ksh ./"test folder"/test.sh
It ran!
>  /usr/ditto/work/temp/temp >

# 5  
Old 09-16-2014
Quote:
Originally Posted by fretagi
Hi

I am trying to run a script in a sub-directory, that has one space on it: such as:
Code:
/internaldisk1/Task Logs1

, but my entry in cron is not working:
Code:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /internaldisk1/Task\ logs1/./remov_reject.sh > /var/tmp/interd_`date '+%Y%M%d'`.log 2>&1

Please can you correct me if I am wrong?
So is the directory name Task Logs1 with a capital "L" or Task logs1 with a lowercase "l"?

There is a good chance that using the same case in both places will fix your problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cannot cd to dir with space

I have a script that I am trying to use. I need it to run from a certain directory. I have tried the following: SCRIPT_DIR=$PWD MYDIR="/filemount/files/Move Files" cd "$MYDIR" $SCRIPT_DIR/movefiles.bash I have tried to run it. but I always get "no such file or directory" from the script... (5 Replies)
Discussion started by: newbie2010
5 Replies

2. Solaris

Disk space being used up while running a script

We have a script which when run consumes the space of the disk from where it is being run. we have to kill this script every time to release space. why do this happen ? any work around please we are using solaris 10 P.S. : a part of the code will make some connection to the DB (1 Reply)
Discussion started by: chidori
1 Replies

3. Shell Programming and Scripting

Script to move all files in a dir into a certain dir

Hello all, I'm very new to shell scripting and need quite urgently to do this thing for my student job. I have a directory called "vectors" with a bunch of files all named ".vector". also i have for each of those files a directory with the name . I now want to move each of those *.vector files... (2 Replies)
Discussion started by: sherresh
2 Replies

4. Emergency UNIX and Linux Support

Command to calculate space for all subdirs under a dir

du -hs command calculates the space for all the subdirs under a dir ...but it is very slow if the dir is huge....is there any quick way ...I am using Sun OS. Thanks, Ajay (19 Replies)
Discussion started by: ajaypatil_am
19 Replies

5. AIX

Running out of space

AIX 6.1 Of course, right at the end of the day I see that my "/" file system is just about out of space. I've been googling and reading man pages, but my google-fu is weak today. How do I find out what is taking all the space? I think I found the process that is cause *some* file to grow but I... (15 Replies)
Discussion started by: Spellbound
15 Replies

6. Shell Programming and Scripting

Need a script to move the files from one dir to other other dir

Need a script to move the files from one dir to other dir and at the same time it has to read the log in the source dir. Please help me ASAP. (4 Replies)
Discussion started by: viswanathkishor
4 Replies

7. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

8. Shell Programming and Scripting

sftp how to deal with space in path to dir?

OK I am trying to use something similar to this: #!/bin/sh echo "OK, starting now..." sftp -b /dev/fd/0 user@remotehost <<EOF cd pub ascii put filename.txt bye EOF only difference is the dir I need to cd to has a space in it like this /Import/Server/Prospect File ,... (3 Replies)
Discussion started by: NewSolarisAdmin
3 Replies

9. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

10. Shell Programming and Scripting

script to go to a different dir to run a commandline prompt in that dir

Hi, I need to know how I'll be able to write a script that can goto a different dir where I don't have access to read,write and execute and also to run a commandline prompt in that dir with one file whose path has to be specified in that command. Will I be able to do this? Any ideas or... (2 Replies)
Discussion started by: ann_124
2 Replies
Login or Register to Ask a Question