keeping in mind that tmp is in the current directory or else give the absolutE PATH.
thanks, i changed it to ./tmp/* just to be clear here - the v option is a good idea, but nothing shows still - just the hang
Quote:
Originally Posted by jim mcnamara
tar sometimes uses
tar cf [tarfile name] [directory]
rather than
tar -cf [tarfile name] [directory]
also add double quotes around the
in case you created a file name with spaces in it.
thanks, sed command (line 2) takes care of the white space output with the date program. I tried doing it without the dash infront of the options, and it still does exactly the same thing.
any other ideas? [i thought this would be a simple script, this is kind of frustrating ]
Need some help.
I need to load data into some Oracle tables and one of the pieces of data that I need to load is the filename. This filename is distinct every single time. Basically the last 6 characters will be different with no pattern.
ex. testfile_041504_003567
To load the filename... (4 Replies)
Anyone who can assist :
I am trying to pass the group vairiable to a filename:
rpt_tsavegrp=/export/legato/scripts/$group_savegrp_rpt.$dat
It will not pass to variable.
Anyone have any ideas what I am doing wrong here.
Thanks
# This script sends email that save group completed.... (3 Replies)
Hi,
In the code below, the $DD1, $DD2, $MM1, $MM2 are not fetching the values. Can anybody tell me where have i made wrong.
Shift_date.sh is a script which gives the previous date if we give the current date in the format YYYYMMDD and +/- how many days past/future.. Like Shift_date.sh... (3 Replies)
Hi all,
I have a scenario as below. I created a file -
$touch myfile.onlytesting.20090227.txt
I want to assign the date only - 20090227 into a variable x.
How do I do this in unix command?
Please help. Thanks;) (4 Replies)
Im trying to set a filename to a variable and then read the file in using the variable but im getting a syntax error. any ideas?
#!/bin/bash
function scanFile()
{
while read $1
do
echo $filename
done
}
file1=report.log
scanFile() $file1 (3 Replies)
Greetings, people of UNIX/Linux forums.
I am having a problem with a script, where I am trying to create a new variable. The value of this variable would be dependent on the value in a couple other previous variables (all variables are 2-digit integers). Here is my code:
#set the stations... (3 Replies)
Hi all,
I want to set the last 4 letter in the filename as a variable.
For example, i have AB1234.txt file and i need to have last 4 letter as a variable.
It should be like ;
get last four letter
set var = 1234
How can i write this in C shell??
Thanks,
zibi (3 Replies)
Hi guys,
I have a variable where i am storing the filename (with full path).
I just need the value before ".txt". But instead of getting the filename i am getting the contents of the filename.
FileName=/appl/data/Input/US/Test.txt
a=`awk -F"." '{print $1}' ${FileName}`
echo $a... (3 Replies)
Hi ,
Am trying to gunzip a file and pass the gunzipped file name to a variable , but its not taking up the value. Am trying to execute the command f=`gunzip <filename>`;echo $f. Here the file is getting gunzipped but the file name is not assigned to the variable. Any help on this will be useful.... (5 Replies)
Hi All,
I have a directory containing multiple files.
and also a txt file which contains the list of all filenames and certain values.
I want to read the text file line by line and if its 2nd column is matched with the filename in directory, then it must insert the values in 7th column to... (14 Replies)
Discussion started by: CAch
14 Replies
LEARN ABOUT OPENSOLARIS
chroot
chroot(1M) System Administration Commands chroot(1M)NAME
chroot - change root directory for a command
SYNOPSIS
/usr/sbin/chroot newroot command
DESCRIPTION
The chroot utility causes command to be executed relative to newroot. The meaning of any initial slashes (/) in the path names is changed
to newroot for command and any of its child processes. Upon execution, the initial working directory is newroot.
Notice that redirecting the output of command to a file,
chroot newroot command >x
will create the file x relative to the original root of command, not the new one.
The new root path name is always relative to the current root. Even if a chroot is currently in effect, the newroot argument is relative to
the current root of the running process.
This command can be run only by the super-user.
RETURN VALUES
The exit status of chroot is the return value of command.
EXAMPLES
Example 1 Using the chroot Utility
The chroot utility provides an easy way to extract tar files (see tar(1)) written with absolute filenames to a different location. It is
necessary to copy the shared libraries used by tar (see ldd(1)) to the newroot filesystem.
example# mkdir /tmp/lib; cd /lib
example# cp ld.so.1 libc.so.1 libcmd.so.1 libdl.so.1
libsec.so.1 /tmp/lib
example# cp /usr/bin/tar /tmp
example# dd if=/dev/rmt/0 | chroot /tmp tar xvf -
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO cd(1), tar(1), chroot(2), ttyname(3C), attributes(5)NOTES
Exercise extreme caution when referencing device files in the new root file system.
References by routines such as ttyname(3C) to stdin, stdout, and stderr will find that the device associated with the file descriptor is
unknown after chroot is run.
SunOS 5.11 15 Dec 2003 chroot(1M)