nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

how to create multiple file in a single command

This is a discussion on how to create multiple file in a single command within the Shell scripting forums, part of the Development/Scripting category; hi, i want to create in the extension of ".txt" IS there any command available for careating the ten file ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2006, 12:21 PM
Junior Member
User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
selvam
Default how to create multiple file in a single command

hi,

i want to create in the extension of ".txt"

IS there any command available
for careating the ten file in the name of

a1.txt , a2.txt, a3.txt .... a10.txt

if u know the command help to me

thanks
Reply With Quote
  #2 (permalink)  
Old 07-25-2006, 12:35 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,697
Thanks: 11
Thanked 243 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Use touch or other command as follows
Code:
touch a{1,2,3,4,5,6,7,8,9,10}.txt
there are other ways too but this is easy for 10 files
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 07-25-2006, 01:10 PM
Junior Member
User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
selvam
Default thanks with a query

hi

ur command is working

thanks

could u tell me more about xargs,awk in shell script
Reply With Quote
  #4 (permalink)  
Old 07-26-2006, 01:01 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,697
Thanks: 11
Thanked 243 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
could u tell me more about xargs,awk in shell script
awk is small programming language pattern scanning and processing with C like syntax. It is quite useful for processing text-based data. Please note that limitations of AWK programs (and sed scripts) lead into development of perl.

xargs build and execute command lines from standard input or shell pipes. For example find all *.tmp file and remove them:

Code:
find . -name "*.tmp" | xargs rm
if you have specific question(s), please start a new topic.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Create new user account in Ubuntu Linux from command line sweta Getting started tutorials 3 02-07-2010 12:15 PM
How to create multiple user account? droidwork Shell scripting 11 02-23-2008 01:35 PM
single DHCP server with multiple VLAN's frank Computer Networking and Internet/broadband 2 12-07-2007 12:38 PM
Lighttpd socket with multiple subdomains or single IP muks Web servers 2 03-17-2007 04:48 AM
HP UX create or add users from command line using useradd rockdalinux HP-UX 0 12-20-2006 02:13 PM


All times are GMT +5.5. The time now is 04:58 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38