![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| moving directories to new directories on multiple servers | mackdaddy07 | Shell Programming and Scripting | 0 | 04-06-2007 12:30 PM |
| How to backup /home directories? | kingsan | SUN Solaris | 1 | 05-03-2006 06:41 PM |
| Delete old home directories | munch | UNIX for Dummies Questions & Answers | 2 | 03-02-2006 01:16 AM |
| HACMP users home directories | zz2kzq | AIX | 1 | 02-21-2006 03:22 PM |
| home network not working! | boris888 | IP Networking | 2 | 05-14-2002 11:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Working with multiple home directories.
I need to rename a directory in every home directory on a given workstation. I am a newb to scripting so maybe thats why I cant exactly figure out how to correctly do this.
The first thing I need to be able to do to write this script is figure out how to list all the directorys (these are not actual home directorys). Im using solaris so that may complicate things for me. ls -d only lists "." so that command is worthless.. for this. find /path/to/users -type d ; somewhat works but it also lists every directory past users. I cant seem to find a way to tell it to only look in the one directory.the output is the following: /path/to/user1 /path/to/user1/dir1 /path/to/user1/dir2 /path/to/user2/ /path/to/user2/dir1 /path/to/user2/dir2 I need to only see /path/to/user1 and /path/to/user2. Anyone have any ideas on else I could try? Also, if it matters, Im using solaris to work on/write this script.. but the actual script will be for OSX, a post install script for an application upgrade. Last edited by trey85stang; 05-16-2008 at 01:14 AM.. |
|
||||
|
awesome penchal!
ls -ltr | grep "^d" | cut -c55-75 will work! Ill see if I can get what I want with dir without having to crep and cut as well ![]() edit: On second though.. is there a way to just print everything from the 55 characters spot to the last character on the line? I think my variables with cut -c55-75 would include spaces tailed at the end? Im thinking tr could be used to do that.. but it would just make the command that much longer? |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|