Sponsored Content
Homework and Emergencies Homework & Coursework Questions How to redirect to another dir? Post 302657741 by methyl on Monday 18th of June 2012 10:11:15 AM
Old 06-18-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to go to a different dir to run a commandline prompt in that dir

Hi, I need to know how I'll be able to write a script that can goto a different dir where I don't have access to read,write and execute and also to run a commandline prompt in that dir with one file whose path has to be specified in that command. Will I be able to do this? Any ideas or... (2 Replies)
Discussion started by: ann_124
2 Replies

2. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

3. UNIX and Linux Applications

CPIO Problem, copy to the root dir / instead of current dir

HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file! I tried all these commands cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies

4. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

5. Shell Programming and Scripting

find string from multiple dir and redirect to new files

Hi, I am new to script and I want find one string from multiple files in diff directories and put that out put to new file. Like I have A,B & C directories and each has multiple files but one file is unic in all the directories like COMM.txt Now I want write script to find the string... (8 Replies)
Discussion started by: Mahessh123
8 Replies

6. Shell Programming and Scripting

Perform action in dir if dir has .git subdir

Hi, I want to run git status for the dir which has subdir ".git" in it with dir path mentioned in output log? If a dir does not have .git subdir then skip that dir. Dir will have 100 main dirs & 500 + subdirs and so on. I appreciate all your help :b: (4 Replies)
Discussion started by: dragon.1431
4 Replies

7. Shell Programming and Scripting

moving files from a dir in one machine to a dir in another machines

Hi, I am a unix newbie.I need to write a shell script to move my oracle READ WRITE datafiles from one serevr to another. I need to move it from /u01/oradata/W1KK/.. to /u01/oradata/W2KK, /u02/oradata/W1KK/.. to /u02/oradata/W2KK. That is, I actaully am moving my datafiles from one database to... (2 Replies)
Discussion started by: mathews
2 Replies

8. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

9. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

10. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies
shar(1) 						      General Commands Manual							   shar(1)

NAME
shar - make a shell archive package SYNOPSIS
[options] [file|dir] ... package DESCRIPTION
The command bundles the named files and directories into a single distribution package suitable for mailing or moving. The files can con- tain any data, including executables. The resulting package, written to standard output, is a shell script file that can be edited (to add messages at the beginning, etc.). To unpack package, use the command with the package name as an argument as follows: When unpacking, the files and directories in package are written to the path names recorded in the archive. If a directory is specified and the option is not given, all files beneath that directory are archived. If a special file is specified, the appropriate commands are emitted to recreate the file (see mknod(1M)). protects the contained files from mail processing, if necessary, by inserting an @ character at the beginning of each line. If the file contains unusual data, the data is transformed into format, and a script is included in package so that the package can still be unpacked correctly by See WARNINGS for more information about mailers and file modifications. Access modes are preserved for both directories and files. Options recognizes the following options: Assume that files can be shipped, regardless of their contents; do not protect them specially. is conservative, and might decide to a file containing special characters (such as Ctrl-G) that the user knows do not need protection. Suppress warning messages regarding optional access control list entries. does not archive optional access control list entries in a file's access control list (see acl(5)). Normally, a warning message is printed for each file having optional access control list entries. Archive files under their base names, regardless of the original path names specified. The contents are thus unpacked into the current directory instead of to the originally specified path names. This allows you to archive files from many directories but unpack them into a single directory. It also allows you to unpack, for example, into instead of overwriting the original one in Append to the package a simple data-integrity check using to ensure that the contents were not damaged in transit (see wc(1)). This check is performed automatically after unpack- ing. Also see WARNINGS below. Insert a line of the form before the archive. If a directory is specified, do not transmit its contents, but rather only create the empty directory. Cause the archive to contain code that notifies the user if his or her current directory is not the same as dir, which must be an absolute path. If the user is not in dir, the unpacking can be continued by responding to the archive's question. Cause the archive to contain code that prevents from unpacking files that would overwrite existing files. Read a list of file names from file and archive those files as if they were given as arguments. Follow symbolic links as if they were normal files or directories. If this option is not specified, archives the link. Retain modification and access times on files when they are unpacked. Preserve user and group ownership on files and directories. Cause the archive to contain code requiring that the user unpacking it be This is useful for processing system archives. Perform error checking using (see sum(1)). Both and can be specified for better error checking. Also see WARNINGS below. Write diagnostics and messages directly to your terminal instead of to the standard error. This is useful when invoking from programs (such as that normally combine standard error with standard output. Specifying also invokes the (verbose) option. Assume that the remote site has for unpacking. If this option is not specified, a version of is sent and compiled if any non-ASCII files are archived. Announce archived file names as they are packed. The option determines the destination for these announcements. Compress files using (see compress(1)). Most options are flagged in the header of the resulting package, thereby recording the format of the archive. The name of the archiver, system, and time/date of the archive are also recorded in the header. EXAMPLES
To archive all files under your home directory, type: or To preserve your directory, type: To send your newest programs in directory in your home directory to a friend, type: RETURN VALUE
returns zero if successful; nonzero if problems with arguments occur. DIAGNOSTICS
If the option is specified, refuses to archive directories. WARNINGS
The modification and access time restoration does not take time zones into account. Files with newline characters in their names scramble the table of contents. Non-ASCII files with white space in their names do not unpack. If a mailer such as elm(1) is used to transfer package to another system and the mailer is configured to expand tabs (by default or other- wise), any file in the archive will be modified if it contains tabs. If the or option is used to create the archive, the data-integrity check will fail during unpacking of any files in package that contain tab characters that were converted to spaces. (Some mailers that expand tabs when transferring files over a network may or may not expand tabs when transferring files to the sender or other users on the local system.) If an editor is used to modify any of the files in package, the data-integrity check will also fail for the files that were changed. AUTHOR
was invented in the public domain. This version of was developed by HP. FILES
For unpacking non-ASCII files if environment variable is set and the directory specified in it is accessible. For unpacking non-ASCII files if environment variable is not set or the directory specified in it is not accessible and directory is accessible. For unpacking non-ASCII files if environment variable is not set or the directory specified in it is not accessible and directory is not accessible. For uncompressing files, which are packed using option, if environment variable is set and the directory specified in it is accessible. For uncompressing files, which are packed using option, if environment variable is not set or the directory specified in it is not accessible and directory is accessi- ble. For uncompressing files, which are packed using option, if environment variable is not set or the directory specified in it is not accessible and directory is not accessible. SEE ALSO
ar(1), compress(1), cpio(1), find(1), tar(1), acl(5). shar(1)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy