I have a simple unix question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers I have a simple unix question
# 1  
Old 12-10-2005
I have a simple unix question

Hello all,
I need to write a little unix script to do some work on multiple files. I need to enter the filenames from the command line (scriptname <filename> <filename>. I have written the code to do double spacing, and some line numbering but it does not take multiple files from the command line. How do I accomplish this? What is the syntax? I used $* to read in all of the args from the command line but it only takes the first filename and ignores the rest. Thanks if anyone can help.
# 2  
Old 12-10-2005
Following piece of code may help ...

Code:
#!/usr/bin/ksh

while test $# -ne 0
do
   echo $1
   shift
done

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

2. Shell Programming and Scripting

Simple question 3

Here I am again~~ I am studying the storing function and dot command. But I found I couldn't load a stored function from a file. This is my command-line and script: $ ls -lsa Total 5 0 drwxr-xr-x+ 1 Administrator None 0 May 9 14:44 . 0 drwxr-xr-x+ 1 Administrator None 0 May 9 10:38 .. 4... (4 Replies)
Discussion started by: franksunnn
4 Replies

3. UNIX for Dummies Questions & Answers

Simple question on unix file permission

As I understand the file permissions in UNIX is basically Owner, group, others Lets assume scott user who's primary group is dev creates a file called test.dat and then grants some privileges on that file... scott@unix-host> echo "this is a test" > test.dat scott@unix-host> chmod 640... (4 Replies)
Discussion started by: luft
4 Replies

4. UNIX for Dummies Questions & Answers

A Simple Question

Hi All, I am new to Unix , I have entered 'cd w' in command prompt and pressed tab key , A tab space is generated instead of listing the folders or files that starts with 'W' . What should i do to get it working:confused: Thanks, Deepak (2 Replies)
Discussion started by: Deepakkumard
2 Replies

5. Shell Programming and Scripting

Simple ls question

i am doing ls -la in the out put , first line is as total 41621 What is this total? (2 Replies)
Discussion started by: Saurabh78
2 Replies

6. UNIX for Dummies Questions & Answers

Some simple question abt Unix kernel

Dear all, I got some questions abt how does the Unix kernel work with the work with the other components. (step by step) Can any body tell me some info abt that? if can provide a example for each question that gonna be perfect! Thank you!!! 1. How file management system work together... (2 Replies)
Discussion started by: melbdavid
2 Replies

7. UNIX for Dummies Questions & Answers

Simple Windows-to-Unix SCP question

Hi, I am fairly new to Unix. My school computers have only UNIX installed on them, and I wish to use them to do some parallel computing. To do so, I need to transfer the files from my Windows computer to my Unix account on a different computer. I am using the SSH login with the Putty client.... (2 Replies)
Discussion started by: Duchesne
2 Replies

8. Programming

Simple C question... Hopefully it's simple

Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
Discussion started by: Xeed
6 Replies

9. UNIX for Dummies Questions & Answers

Ok simple question for simple knowledge...

Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies

10. Shell Programming and Scripting

Simple Unix Question

Hi all, ok here is my problem, my program below is reading lines in from a file (one at a time) and printing them out. my problem is that i want it to only print out 3 lines at a time on the screen, but the "read value" command in my code isnt working. Whats wrong? & what can i do to get this... (1 Reply)
Discussion started by: djt0506
1 Replies
Login or Register to Ask a Question