I want to read the content of a specific folder


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I want to read the content of a specific folder
# 8  
Old 08-21-2015
look like here:

Image

The actuall script are in Modul2, the sh script safed in shellscript.
I want to output the content of workspace so like test.
# 9  
Old 08-21-2015
In post#1 you want to read files, in #4 you want to write. The path listed in #1 doesn't necessarily match the picture in #4. And, in your other post with the same topic, you don't answer relevant questions.

Why don't you get your act together and provide the information requested, so people have a chance to help?

BTW, you seem to use sh which does NOT provide arrays.
# 10  
Old 08-21-2015
What exact output do you get when you run the command:
Code:
/bin/sh -xv script_name

where script_name is the name of the file containing your script?
# 11  
Old 08-21-2015
Huh? The ls -d file command says you want to list file itself (even if it is a directory); not to list the files in file if file is a file of type directory.
# 12  
Old 08-21-2015
The script containing here:
Code:
/typo3cms/cms_*****/fotouploadv2/Modul2/shellscript

When i execute it over PHP:
Code:
I am here /typo3cms/cms_*****/fotouploadv2/Modul2/

I want to read these File:
Code:
/typo3cms/cms_*****/fotouploadv2/Modul2/workspace

But my output are noting.
When I use the sript like down.
Code:
#!/bin/sh

array=($(ls -d /typo3cms/cms_*****/fotouploadv2/Modul2/workspace))
 echo ${array[@]}


Last edited by rbatte1; 08-25-2015 at 09:52 AM.. Reason: CODE tags
# 13  
Old 08-21-2015
Moderator's Comments:
Mod Comment Trying to follow what is going on in these two threads is way too confusing.

I am going to merge these two threads into the original thread and hope people who started reading in one thread or the other will be able to figure out how this stuff is related.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Linux read specific content file from tar.gz files without extracting

hello i wish to write the result of these below conditions in a file: 1. in a specific folder, i have many tar.gz files. 2. each tar.gz file contains ".dat" file in sub folders. 3. i wish to get the full path of these .dat files, if i find in it a specific word ("ERROR24"). 4. all this... (6 Replies)
Discussion started by: jimmyjames9
6 Replies

2. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

3. Shell Programming and Scripting

How can i move folders and its content if folder is older than 1,5 days and keep subdirs in bash?

Hello all, do you know any way i can i move folders and its content if folder is older than 1,5 days in bash? I tried: find /home/xyz/DATA/* -type d -ctime +1.5 -exec mv "{}" /home/xyz/move_data_here/ \;All i got was that Files from DATA /home/xyz/DATA/* ended messed up in... (1 Reply)
Discussion started by: ZerO13
1 Replies

4. Shell Programming and Scripting

Bash script read specific value from files of an entire folder

Hello, I heva a problem creating a script that read specifc value from all the files of an entire folder I have a number of email files into a directory and i need to extrect from each file 2 specific values. After that i have to put them into a new file that looks like that: To: value1 ... (1 Reply)
Discussion started by: ahmenty
1 Replies

5. Shell Programming and Scripting

Delete all content in folder and not show any stderr/stdout

Hi i am a newbie, and have trying something that looked easy at first sight. in this script i want to delete all the files and directories in subdirectory1 (but not delete subdirectory1) and dont show any stderr or stdout messages: i try this but the stderr and stdout is shown...and it says... (2 Replies)
Discussion started by: bash100
2 Replies

6. Shell Programming and Scripting

Reading files under a folder and formatting content of each file

I have 'n' number of files in a folder .each file in the folder "myfolder" is having the content like. COLNAME ------------ AAAAAA BBBBBB CCCCCC DDDDDD ... ... ... ZZZZZZ 26 recrod(s) selected. My request is by reading each file in "myfolder" and format each file such a way... (18 Replies)
Discussion started by: rocking77
18 Replies

7. Shell Programming and Scripting

How to copy specific file.txt in specific folder?

hye there... i have a problem to copy file in specific folder that will change the name according to host,time(%m%s) and date(%Y%M%D) example folder name: host_20100531.154101801 this folder name will always change... but i just want to copy the AAA.txt and BBB.txt file.. really need... (17 Replies)
Discussion started by: annetote
17 Replies

8. UNIX for Dummies Questions & Answers

Zip recursive content of folder when (not current directory=

Hi, Is there a way to zip the content (recursively) of a folder other then the current directory, and keep the directory structure intact? Example: /var/tmp/myfolder ----------------- file1 ----------------- file2 ----------------- folder1 ------------------------ file3 Now I want... (3 Replies)
Discussion started by: jimih
3 Replies

9. Shell Programming and Scripting

Can I use read to read content of a variable

Can I use the read command to read the contents of a variable? I'm trying by using the following code and getting nothing back. I'm in a Linux environment. #!/bin/ksh IFS=~ VAR1=1~2~3~4 echo $VAR1 | read a b c d print "$a $b $c $d" (9 Replies)
Discussion started by: nmalencia
9 Replies

10. Shell Programming and Scripting

how to store the first content of the folder in a variable?(Urgent)

Hi All, I need urgent help. Because just now i have to give this code to my client. I have a folder name is Testing. this Testing folder contains the following 3 files. 1.txt 2.txt 2.txt Now I want to store the first value of my folder in a variable say suppose $a. Means i want that... (3 Replies)
Discussion started by: sunitachoudhury
3 Replies
Login or Register to Ask a Question