Sponsored Content
Top Forums Shell Programming and Scripting rename all file with blank in directory from home root , please help me Post 302702491 by giankan on Tuesday 18th of September 2012 12:03:23 PM
Old 09-18-2012
rename all file with blank in directory from home root , please help me

hi ,

Smilie

I've in directory home user 3 file with blank space in name file, I would like erase the all character that no have alphanum more dot in namefile from home root , below the script.
If I execute the shell script from directory where stay it's execute well done.But I would like execute the script from home root , like so:
/var/www/html/regia0/temp/f/./ren in this case after execute the sh script erase all file in /var/www/html/regia0/temp/f/ and no rename the files, below the script work well only if I execute from the same directory where is present the hidden script. Please Help me
SmilieSmilieSmilie
Thanks a lot


Code:
#ren.sh
for file in *
do
mv "$file" $(echo "$file" | sed 's/[^A-Za-z0-9.]//g')
done;

---------- Post updated at 11:03 AM ---------- Previous update was at 10:41 AM ----------

ok, I'm solved It's was very simple

Code:
cd /var/www/html/regia0/temp/f  #  here the solution
for file in *
do
mv "$file" $(echo "$file" | sed 's/[^A-Za-z0-9.]//g')
done;

Thanks again at this forum
 

10 More Discussions You Might Find Interesting

1. Solaris

running sshd server from home directory without root access

Hi, I managed to install openssh from source on my home directory on a server I don't have root access to. I had problems with privilege separation because of permissions initially so I disabled it in sshd_config. But when I run sshd from where I installed it by doing ~/local/sbin/sshd, nothing at... (0 Replies)
Discussion started by: sayeo
0 Replies

2. UNIX for Dummies Questions & Answers

How to get the latest modified file name in /home directory?

I only know how to list all sub-directories or files in specified directory. I don't know how to order them by modified date, furthermore, I don't know how to get the top one file in the sorted list. Wish you can do me a favor. Thanks in advance! (3 Replies)
Discussion started by: crest.boy
3 Replies

3. Shell Programming and Scripting

Rename multiple file names in a directory

I hope some one can help me I have multiple files in a directory with out extension like as below mentioned. But i want to change all the file names along .DDMMYYYYHHMISS format. And all files should have same DDMMYYYYHHMISS. Scenario: direcory name = /vol/best/srcfiles files in a... (4 Replies)
Discussion started by: hari001
4 Replies

4. Shell Programming and Scripting

Rename last directory in a file structure

I have to write a script to rename the every last sub-directory in a directory structure if the last sub-directory name doesn't contain "submitted". eg: given directory path:/u01/home/somedir somedir can have many subdirectories and each subdirectory inturn has many subdirectories. somedir... (3 Replies)
Discussion started by: ramse8pc
3 Replies

5. Shell Programming and Scripting

Looking for config file in home directory first??

hi, i have written a shell script inside which i am using a pgp command to encrypt a file. when pgp command is run , there is a /.pgp/pgp.cfg file in my home directory. i logged into the unix server with my userid, when i run the script from the command prompt, pgp is successful, since i am... (5 Replies)
Discussion started by: Little
5 Replies

6. Shell Programming and Scripting

Cannot run this .java file from the home directory??

I wrote a simple test.java program in vi. I know it compiles correctly because I went into the directory where test.java was and compiled it and it created a java.class. I then ran test.java by staying in the same directory where it was and it worked great. However, when i backed out of the... (3 Replies)
Discussion started by: syregnar86
3 Replies

7. Shell Programming and Scripting

Find users with root UID or GID or root home

I need to list users in /etc/passwd with root's GID or UID or /root as home directory If we have these entries in /etc/passwd root:x:0:0:root:/root:/bin/bash rootgooduser1:x:100:100::/home/gooduser1:/bin/bash baduser1:x:0:300::/home/baduser1:/bin/bash... (6 Replies)
Discussion started by: anil510
6 Replies

8. Shell Programming and Scripting

Rename specific file extension in directory with match to another file in bash

I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies

9. UNIX for Beginners Questions & Answers

Rename the file name from Parent directory

Hi All, Just started learning unix and stuck into below issue. Suppose i have folder structure as below. Dir1/Dir2/Dir3/File1.msg I am looking to rename the file name from File1.msg to File2.msg but from the parent Dir1 From Dir3 i can easily run the command like mv File1.msg... (2 Replies)
Discussion started by: Gurjeet Singh
2 Replies

10. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies
FLAMEROBIN(1)						   Firebird Administration Tool 					     FLAMEROBIN(1)

NAME
flamerobin -- management and data manipulation tool for the Firebird DBMS SYNOPSIS
flamerobin [-h directory | --home=directory] [-uh directory | --user-home=directory] DESCRIPTION
flamerobin is a graphical frontend to the Firebird DBMS. It is small and simple, yet offers all the basic features needed to create and manipulate databases, execute queries and perform administrative tasks. This manual page only documents the run-time options and environment of flamerobin. Information about using the GUI may be obtained by selecting the Help -> Manual menu item once the application is running. flamerobin uses two directory hierarchies for its normal operation. The data directory contains the templates for property pages, the default configuration and the on-line documentation grouped into three sub-directories as follows: conf-defs default configuration docs on-line documentation html-templates templates for property pages The user home directory contains the per-user configuration, comprising three entries: fr_databases.conf this file stores the user's registered databases. fr_settings.conf this file stores the user's preferences related to the flamerobin GUI. history this directory holds the SQL statement history, one item per file. flamerobin accepts several options, which are described as follows: -h directory --home=directory Use directory as the data directory (but see ENVIRONMENT below). -uh directory --user-home=directory Use directory as the user home directory (but see ENVIRONMENT and CAVEATS below). ENVIRONMENT
FR_HOME Specifies an alternate location for the flamerobin data directory. If both -h (or --home) and this environment variable are set, the command line argument takes precedence. FR_USER_HOME Specifies an alternate location for the flamerobin user home directory. If both -uh (or --user-home) and this environment variable are set, the command line argument takes precedence. FILES
/usr/share/flamerobin The default flamerobin data directory. ~/.flamerobin The default flamerobin user home directory. AUTHORS
flamerobin was written by The FlameRobin Development Team <http://www.flamerobin.org/>. CAVEATS
flamerobin only writes files under the user home directory. If flamerobin is configured so that this directory and the files contained therein are shared among several users or concurrent instances of flamerobin, no precaution is taken to avoid overwriting settings created by other users or other application instances. NOTES
The specification of the data directory and the user home directory (regardless of whether they occur in the environment or on the command line) may be the literal string ``$app'' which translates to a common data folder determined at compilation time, or ``$user'' which trans- lates to the user local data directory. These options currently have effect only on Windows platform. FlameRobin 0.7 April 12, 2006 FlameRobin 0.7
All times are GMT -4. The time now is 10:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy