Help make script much easier


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help make script much easier
# 1  
Old 03-17-2006
Help make script much easier

Quote:
filelist=`ls *.log`
for file in ${filelist}
do
line=${file}:${line}
done
Is there any method to realise this in one command?
Thanks in advance
# 2  
Old 03-17-2006
Do away with the ls call.

Code:
for file in *.log ;do line="$file:$line" ;done

# 3  
Old 03-18-2006
I would like to know what this script is doing.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Consolidate several lines of a CSV file with firewall rules, in order to parse them easier?

Consolidate several lines of a CSV file with firewall rules Hi guys. I have a CSV file, which I created using an HTML export from a Check Point firewall policy. Each rule is represented as several lines, in some cases. That occurs when a rule has several address sources, destinations or... (4 Replies)
Discussion started by: starriol
4 Replies

2. UNIX for Dummies Questions & Answers

An easier way to move character from field to a new line

Hi ! Is there a more convenient way to do the following: When, in $2, there is more then one letter (separated by ","), it returns the letter on the second position to a new line in $2 with the same content in $1 and $3 as the line this letter comes from. infile: aaaaa A,B 1,2,3,4,5... (6 Replies)
Discussion started by: lucasvs
6 Replies

3. UNIX for Dummies Questions & Answers

SSH - please make my life easier

I know this is probably a really stupid question, with a really stupidly simple answer. So I've got a Mac, and I have to do a bunch of work via SSH on a Solaris workstation owned by my university. I've already got keys set up, and my ~/.ssh/config file set up as follows: Host prime ... (6 Replies)
Discussion started by: oboewan
6 Replies

4. What is on Your Mind?

Easier solution to transfer blu-ray and DVD to iPad

Easier solution to transfer blu-ray and DVD to iPad with just one mouse click Because of its 9.7-inch 1024×768 high resolution multi-touch screen, iPad is convenient and comfortable for users to read newspapers, magazines, books, view photos, experience the web, touch emails, and watch any... (0 Replies)
Discussion started by: Molica
0 Replies

5. Shell Programming and Scripting

how to run script? call other script? su to another user? make a cron?

Good morning. I am searching for "how-to"'s for some particular questions: 1. How to write a script in HP-UX 11. 2. How to schedule a script. 3. How to "call" scripts from the original script. 4. How to su to another user from within a script. This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies

6. Programming

make script

I need to write a make script to install a C module in a UNIX environment.It should install the sources, build the libraries and install them and also install the info pages on the system. Can this script be general enough to also install on windows, windows dll, windows help file's etc. Any... (3 Replies)
Discussion started by: cherio
3 Replies

7. Cybersecurity

Dancing a samba is easier :(

Hello everybody, I am trying to get a suse linux computer ( 7.2 ) to show me my home directory under windows. I got samba started, and I can see the linux computer under windows, but when I try to open it, I get a login box. That is not so bad :) but I can't log on. I am using windows 2000 and I... (5 Replies)
Discussion started by: Micky
5 Replies
Login or Register to Ask a Question