Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] banal bash script opinion
- Date: Sat, 17 May 2003 17:37:05 +0200
- From: Pietro Zuco <pietro@example.com>
- Subject: [tlug] banal bash script opinion
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1
Hi. I wanted to write a script that I pass the name of a file, the new name I want it had and a number indicating the number of copies of that file with the new names that I want. Do it for me thanks .. . . . . . . . . . . . . . . . . ps: don't get furious it was a joke ;-) I wrote the script and it worked well for my needs. I just wanted to know some suggestions about it, if it could be made in less lines. I know this is a banal script but I'm learning bash scripting. Thank you in advance. I pass the name of an existing file, the new name for the copies and the numer ./scriptname filename.extension newfilename.extension number_of_copies #!/bin/bash x=0 extension=$(echo $1 | sed -n -e 's/[[:print:]]*\.//gp') if [ -z $extension ] then while [ $x -lt $3 ] do cp $1 $2$x x=`expr $x + 1` done else while [ $x -lt $3 ] do cp $1 $2$x.$extension x=`expr $x + 1` done fi
- Follow-Ups:
- Re: [tlug] banal bash script opinion
- From: Susumu ISHIZUKA
- Re: [tlug] banal bash script opinion
- From: Josh Glover
- Re: [tlug] banal bash script opinion
- From: Pietro Zuco
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Workaround for Japanese IM in RH 8. Plus: is MS stylelocalization the best we can do?
- Next by Date: [tlug] A SCO letter
- Previous by thread: Re: [tlug] Microsoft with pants down again
- Next by thread: Re: [tlug] banal bash script opinion
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links