Sponsored Content
Top Forums Shell Programming and Scripting change file extension from root and subdirectories Post 302167846 by Astrid on Friday 15th of February 2008 03:52:38 PM
Old 02-15-2008
Thank you for the quick reply, robotronic!

But I am sorry to say that I could not get it to work.

The script runs and then I get prompt again but there is no indication if it goes wrong somewhere, I even tried to change the video root to a dummy directory to invoke some feedback but to no avail. Smilie

I've used "touch" to make some dummy files in the specified directory and subdirectories: some with the same name but different extension (.img and .iso, obviously, and some other just to see if they are affected), and some files with different permissions (chmod 777 on most).

But not one changed the extension.

The script itself is located in one directory level above the "media root" (as set in the script).


Code:
$ ls -l img2iso
total 0
-rwxrwxrwx    1 astrid  619956085    0 Feb 15 13:01 dummy.img
-rw-r--r--   1 astrid  619956085    0 Feb 15 21:50 dummy.iso
-rwxrwxrwx    1 astrid  619956085    0 Feb 15 13:01 example.img
-rw-r--r--    1 astrid  619956085    0 Feb 15 21:35 example_no_permission.img
-rwxrwxrwx    1 astrid  619956085    0 Feb 15 13:01 image.img
-rw-r--r--    1 astrid  619956085    0 Feb 15 13:01 isoimg.iso
drwxr-xr-x    2 astrid  619956085   68 Feb 15 12:53 level1a
drwxr-xr-x    9 astrid  619956085  306 Feb 15 13:00 level1b

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change extension?

How do you write a shell script that change the extension of all the files? e.g chext rtf doc where .rtf is the original extension and .doc is the new extension is it something to do with basename? do I need a for loop? Please help! Unix SuperNewbie (4 Replies)
Discussion started by: prkwan
4 Replies

2. Shell Programming and Scripting

how do i change extension

Hi I am writing a script which does an FTP of a set of files onto another machine and then would have to rename the files into a different extension on the source machine. for example if the file being sent via FTP is sample.txt. Once the file has been transferred i would want to modify the... (2 Replies)
Discussion started by: kswaraj
2 Replies

3. Homework & Coursework Questions

Create file and then change the extension case.

Interpreter should be bash. 1. The problem statement, all variables and given/known data: I need to make a file (myText.txt or song.mp3 or cloud.tar.gz or whatever) and then change the extension to (myText.TXT , song.MP3, cloud.TAR.GZ). It would be good if I can add all information in... (4 Replies)
Discussion started by: Kdenmen
4 Replies

4. UNIX for Dummies Questions & Answers

Shell script to rename or change file extension case.

I searched the forum, but there was different type of rename. Hello. I have files in folder. Like: xxxxxxxx1.html or xxxxxxxx2.txt or xxxxxxxx3.tar.gz and how to rename or change file extension case to xxxxxxxx1.htm or xxxxxxx2.TXT or (5 Replies)
Discussion started by: Sheldon
5 Replies

5. Shell Programming and Scripting

shell script to change the extension of a file

I have a directory that contains several files, out of which some files are have an extra extension for example file1.new.new.new file2.new.new.new file3.new.new.new file4.new.new.new i want to write a shell script that rename all such file with only single extension like file1.new... (7 Replies)
Discussion started by: mukulverma2408
7 Replies

6. Shell Programming and Scripting

List files with *.i extension in a directory and all its subdirectories + 30days old then remove

I need to write a script to : list files with *.i extension in a directory and all its subdirectories + 30days old, save it in a file and then remove (2 Replies)
Discussion started by: lena keung
2 Replies

7. Ubuntu

Root access that can't change root password?

We are having a little problem on a server. We want that some users should be able to do e.g. sudo and become root, but with the restriction that the user can't change root password. That is, a guarantee that we still can login to that server and become root no matter of what the other users will... (2 Replies)
Discussion started by: 244an
2 Replies

8. UNIX for Beginners Questions & Answers

UNIX command to display Owner,Group,Root and Subdirectories list

Hi Team, Am a newbie to Unix. As I would like to see the Server Name,Owner Name ( not numeric form), Group Name ( not numeric ID), ROOT path. I would like to send this list as an attachment to my personal mail. Can any one please help me out to to resolve this . Here is the sample result... (6 Replies)
Discussion started by: vasuvv
6 Replies

9. Shell Programming and Scripting

Change file extension

Hi Guys, i am trying to redirect a file wherein i need to change the extension of the file from .sh to .tmp, but getting an error a=test.txt sh test.txt > path/$(basename "$a" .sh).tmp i need test.tmp ---------- Post updated at 02:09 AM ---------- Previous update was at... (3 Replies)
Discussion started by: rohit_shinez
3 Replies

10. UNIX for Beginners Questions & Answers

Can a root role change the root password in Solaris 10?

i do not have root on a solairs 10 server , however i do have the root role, i was wondering if I can change the root password as a a role with the passwd command? I have not tried yet. and do i have to use the # chgkey -p afterwards? i need to patch is why i am asking. thanks (1 Reply)
Discussion started by: goya
1 Replies
img-bmp(n)																img-bmp(n)

__________________________________________________________________________________________________________________________________________________

NAME
img-bmp - Img, Windows Bitmap Format (bmp) SYNOPSIS
package require Tk package require img::bmp ?1.4? image create photo ?name? ?options? _________________________________________________________________ DESCRIPTION
The package img::bmp is a sub-package of Img. It can be loaded as a part of the complete Img support, via package require Img, or on its own, via package require img::bmp. Like all packages of Img it does not provide new commands, but extends the existing Tk command image so that it supports files containing raster images in the Windows Bitmap Format (bmp). More specifically img::bmp extends Tk's photo image type. The name of the new format handler is bmp. This handler does not provide additional configuration options. All of the above means that in a call like image create photo ?name? ?options? [1] Image data in bmp format (options -data and -file) is detected automatically. [2] The format name bmp is recognized by the option -format. SEE ALSO
img-bmp, img-dted, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img- tga, img-tiff, img-window, img-xbm, img-xpm KEYWORDS
bmp, image handling, tk COPYRIGHT
Copyright (c) 1995-2009 Jan Nijtmans <nijtmans@users.sourceforge.net> Img 1.4 img-bmp(n)
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy