The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
please convert the below program into shell script mail2sant Shell Programming and Scripting 3 04-10-2008 08:39 AM
Need help on C-shell script program haze21 Shell Programming and Scripting 1 11-14-2007 09:04 PM
How to include shell script in C program mridula High Level Programming 5 07-30-2006 03:13 AM
ftp files from Unix to Windows through shell program whatisthis Shell Programming and Scripting 7 05-04-2005 09:28 AM
shell script program jayaram_miryabb Filesystems, Disks and Memory 1 03-09-2005 08:12 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-04-2007
cdfd123 cdfd123 is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 112
Post want to run different files under the same program using shell script

suppose have different files
1.1
2.2
3.3
4.4
5.5

All the files have to run under the same command say
tr -d '\n'

so how to run all the files under the same command by using shell script
  #2 (permalink)  
Old 10-04-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Do you mean removing all linefeed characters ...

Code:
for d in *.*
do
   tr -d '\n' <$d >tmp
   mv tmp $d
done
  #3 (permalink)  
Old 10-04-2007
cdfd123 cdfd123 is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 112
Quote:
Originally Posted by porter View Post
Do you mean removing all linefeed characters ...

Code:
for d in *.*
do
   tr -d '\n' <$d >tmp
   mv tmp $d
done
Simply having all those files say abc,def,ghi,fdg,dgg
and print the new files
can i follow like that
for d in abc, def, ghi, fdg, dgg
do
tr -d '\n' <$d >tmp
mv tmp $d
done

or what else give option
thanks
  #4 (permalink)  
Old 10-04-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
what are the commas for?

The "for" statement takes elements separated by the normal white space rule.

I thought you wanted the files changed, not printed, hence the ">tmp" and "mv tmp $d".

man tr
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0