File Space Problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers File Space Problem
# 8  
Old 09-03-2008
issue resolved

Last edited by chris1234; 09-03-2008 at 05:39 PM..
# 9  
Old 09-03-2008
Quote:
Originally Posted by chris1234
Code:
#!/bin/sh
 
CSV_FILE="/home/micheal/temp/file1.csv"
 
cd /home/chris/test
#for line in $( cat $PROP_FILE ); do
    while read line; do
    FOLDER_VAR=`echo "$line"|awk -F"," '{print $1}'`
    echo "Folder is " $FOLDER_VAR
    PATH_VAR=$( echo $line | cut -d"," -f2  )
    USER_VAR=$( echo $line | cut -d"," -f3)
    SERVER_VAR=$( echo $line | cut -d"," -f4)
 
    for dir in *; do
 
    if [ -d "$dir/$FOLDER_VAR" ]; then
       echo $FOLDER_VAR " Does exist"
    if [ "$SCP_VAR" = "Y" ]; then
 
     /usr/local/bin/ssh -l $USER_VAR $SERVER_VAR \
     "mkdir -p 777  $PATH_VAR/$dir/$FOLDER_VAR"
    fi
    else
       echo $FOLDER_VAR "does not exist"
    fi
done
#done
done < $CSV_FILE

I am using this code and for some reason it just reads the first row and creates the appropriate directories. It does not read any more rows. Any clues ?
try
done < `echo $CSV_FILE` not sure it should work fine
# 10  
Old 09-03-2008
Nope. same result. Reads only first row.
# 11  
Old 09-03-2008
If i use a for loop it works fine but then the one which contains space is not read as one word
# 12  
Old 09-03-2008
try running your script as
sh -x scriptname
you may able to find some bug.. or post the out put..
# 13  
Old 09-03-2008
It's a huge output. But i don't see anything unusual or a bug
# 14  
Old 09-03-2008
Hi, would this work, as a suggestion to Your first problem?

Code:
lakris@ubuntu:~/projekt/scripts$ cat crap.txt 
chris doc,male
test,female
lakris@ubuntu:~/projekt/scripts$ cut -d"," -f1 crap.txt 
chris doc
test
lakris@ubuntu:~/projekt/scripts$

/Lakris
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Problem space used on AIX 5.3

Hello everyone, Sorry for my English but i'm French. I have a problem on an AIX 5.3 server on the occupation of a file system. When i run a df -m, this is what i get : Filesystem MB blocks Free %Used Iused %Iused Mounted on /dev/fslv09 3936.00 340.94 92% 7255 ... (8 Replies)
Discussion started by: Veis
8 Replies

2. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

Hi, I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

3. UNIX for Advanced & Expert Users

Swap space problem

Hy! Recently i had a problem with one of mine Tru64 machines. It started to kill processes because of low amount of swap space. It said that it went below 10 %. But when i ran swapon -s it said: In-use space: 12 % So, the system couldn't accept any new ssh connections plus it killed most of... (1 Reply)
Discussion started by: veccinho
1 Replies

4. UNIX for Dummies Questions & Answers

Space problem in files

Hi, I have a file containing a list of entries. Want to do ls on them. for a in `cat <list.txt>`; do ls $a; done; Now some entries contain spaces. How do i incorporate space in $a. Quoting $a in "" doesn't help. Thanks (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

5. UNIX for Dummies Questions & Answers

Unix -- Space problem -- File number limitation?

Dear all Recently I cant touch file in one mount point (which is not full, 78% full only), it says can't write to device, obviously it means it's full, I deleted some files and I can write some files only. I wonder is there any file number limitation in a mount point and how can I check or how... (2 Replies)
Discussion started by: shanemcmahon
2 Replies

6. Shell Programming and Scripting

Everywhere space problem

Solved.... (1 Reply)
Discussion started by: redbeard_06
1 Replies

7. UNIX for Dummies Questions & Answers

Linux space problem

I am very new to Linux and trying to install Oracle 9.2 on Red Hat Linux 7.2. My problem: /tmp needs to be larger in order to install Oracle. It is 64MB now. How can I resize this? I'm totally confused !! Thanks. (7 Replies)
Discussion started by: canova
7 Replies

8. Filesystems, Disks and Memory

problem with swap space

I have sun solaris 8 for intell with 128m physiccal ram and swap of 148. Oracle requires to have 512M swap space. Is there a way I can change the swap space on intell machine without repartioning the box:? what if i create a link to /swap from another place???? pls advise Jigar (1 Reply)
Discussion started by: jigarlakhani
1 Replies

9. UNIX for Advanced & Expert Users

Problem with space

I am in the initial stage of learning UNIX. I got PC with Intel SUN SOLARIS S/W. I am planning to install Oracle on the same machine. I have created /export with more than 3gb space, when I have installed the OS. As a Oracle user when I am trying to create a directory I am able to get only 512... (4 Replies)
Discussion started by: suraj
4 Replies

10. UNIX for Dummies Questions & Answers

root file system space problem

Dear all My actual root file system size is 1 gb, only OS installed . other than OS i did n't installed in this slice. but It shows 100% full. When try to create space , I couldn't find any files other than OS. What may be the reason? Help.... any one pls. (2 Replies)
Discussion started by: sbaloo
2 Replies
Login or Register to Ask a Question