Sponsored Content
Top Forums Shell Programming and Scripting change file extension from root and subdirectories Post 302167963 by robotronic on Saturday 16th of February 2008 05:45:27 AM
Old 02-16-2008
Now it's clear why the script doesn't work Smilie

Unfortunately I really don't know anything about the Mac's world, so I can't help you anymore.

The obvious thing about the message "bad interpreter" is that it can't find the bash binary "/bin/bash" defined at the top of the script. If you issue "ls -l /bin/bash" what's the output?

About the "sh -x" thing, on Linux "sh" is a symbolic link to bash and it does work. On Mac I dont'know. To overcome this you can insert a line with the command "set -x" just before the video directory variable assignment. The effect is the same, but before you have to fix the interpreter problem or this is totally useless.

And about the "cat" command, it seems that your script file is a bit messed up.....
 

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
patchmedia(1M)						  System Administration Commands					    patchmedia(1M)

NAME
patchmedia - modify Solaris media with patches and packages SYNOPSIS
/usr/bin/patchmedia -d media-root [-v] [-o iso] [-l label] pkg_or_patch [pkg_or_patch ...] DESCRIPTION
The patchmedia utility takes a list of patches and packages as input and updates the install miniroot in media-root (the root directory of an on-disk image of a Solaris installation media) to include the specified patches and packages. These patches and packages are also placed in a subdirectory called DU under the Solaris install image. For example: media-root/Solaris_10/DU When booting a system from the updated media, the patches and packages will be part of the booted Solaris image. They will also be applied to the target system being installed at the end of the installation process. If -o is specified, a bootable ISO image is created in the file media.iso that contains the Solaris install media. The ISO image can then be burned onto a CD/DVD with utilities such as cdrw(1) or cdrecord(1). (The latter is not a SunOS man page.) OPTIONS
The following options are supported: -d media-root Top-level directory of on-disk image of Solaris installation media. This is option must be specified. -o iso Create a Solaris ISO image of media-root. -l label Label/volume name of the ISO image (if -o option is specified). If -o is not specified, the name of Solaris directory under media-root, for example, Solaris_10, will be used. -v Verbose. Multiple -v options increase verbosity. OPERANDS
The following operands are supported: pkg_or_patch [pkg_or_patch ...] One or more patches or packages (you can have both patches and packages in a single command) with which the Solaris installation media media-root will be updated. EXAMPLES
Example 1 Updating a Solaris Install Image with Patch and Package The following command updates the Solaris install image in s10u1 by adding patch 123456-07 and package SUNWfoo. # /usr/bin/patchmedia -d s10u1 SUNWfoo 123456-07 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
cdrw(1), mkcd(1M), attributes(5) mkisofs(8), (/usr/share/man/man8/mkisofs.8), in the SUNWfsman package (not a SunOS man page) SunOS 5.11 29 Jul 2008 patchmedia(1M)
All times are GMT -4. The time now is 10:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy