I have this idea.
I have a variable for the start of someones log in time,
(start=`who am i | cut -c30-34`)
and a variable for the log out time or present time,
(end=`date | cut -c12-16`)
but how do I go about subtracting them to get the total log in time.
I've tried adding a another variable... (2 Replies)
I'm new to unix scripting. How would I go about pulling the first 3 characters from a variable in ksh and storing in another variable? Thanks. (9 Replies)
With C Shell you can get the root, head, tail and extension of a pathname by using pathname variable modifiers.
Example Script:
#! /bin/csh
set pathvar=/home/WSJ091305.txt
echo $pathvar:r
echo $pathvar:h
echo $pathvar:t
echo $pathvar:e
The result of executing this script is:
... (7 Replies)
Hey all,
I have been using Ksh and in that I am setting Environment variables.
To set Env. Variables I have created my own file "BuildScript.sh" in which i have written :
export CLASSPATH=/somedir/some other dir/file:.
export PATH=/some dir/file:.
But when i am calling this... (4 Replies)
Hi, i need help passing variables to sed using ksh.
My goal is to get particular data from log files.
first i put a mark to the log files.
echo "TEST_"`date + %m_%d_%Y_%T"` >markFile
this will produce a 'markFile' which contain text like this
TEST_06_01_2009_21:55:09
then i put the mark... (2 Replies)
I'm trying to set a variable to the output of a command.
This is what the comand output to the display looks like:
/>hciconndump -v TOsiu
Dump of connection(s): TOsiu
----------------------------------------------------------------------
Process: A60Tsiu Connection: TOsiu... (2 Replies)
I can't believe I can't figure this out... given this code:
CARS_DATA_LIST=`cat /tmp/file1 | awk '{print $1}' `
FMSA_DATA_LIST=`cat /tmp/file2 | awk '{print $1}' `
The value of each of the above variables is:
CARS = a b c d e f g
FMSA = a b c q r s
I want to declare a third... (8 Replies)
Hi,
I 'm trying to send an e-mail for every different line in the .txt
for i in {1..$variable}
do
sed -n "/$i$/p" text.txt
done
I have two problems about this.
First one is that for loop doesn't work
and the second one is that i cant get the output of sed (4 Replies)
Cannot combine these two strings into one line, either as a 3rd variable or echo or printing ? Frustrating.
for i in `cat /scripts/pathList.dat`
do
OldRepo= grep Oldhostname ${i}/.svn/entries | tail -1
NewRepo= grep Oldhostname ${i}/.svn/entries | tail -1 | sed '/Oldhostname/... (41 Replies)
Hi Friends ,
I want to know how to format the output for the following:
i searched in the forum and couldnt get the exact requirement.
Thanks in advance . (2 Replies)
Discussion started by: i150371485
2 Replies
LEARN ABOUT SUNOS
mt
mt(1) User Commands mt(1)NAME
mt - magnetic tape control
SYNOPSIS
mt [-f tapename] command... [count]
DESCRIPTION
The mt utility sends commands to a magnetic tape drive. If -f tapename is not specified, the environment variable TAPE is used. If TAPE
does not exist, mt uses the device /dev/rmt/0n.
OPTIONS
The following option is supported:
-f tapename Specifies the raw tape device.
OPERANDS
The following operands are supported:
count The number of times that the requested operation is to be performed. By default, mt performs command once. Multiple opera-
tions of command may be performed by specifying count.
command Available commands that can be sent to a magnetic tape drive. Only as many characters as are required to uniquely identify
a command need be specified.
eof Writes count EOF marks at the current position on the tape.
weof
fsf Forward spaces over count EOF marks. The tape is positioned on the first block of the file.
fsr Forward spaces count records.
bsf Back spaces over count EOF marks. The tape is positioned on the beginning-of-tape side of the EOF mark.
bsr Back spaces count records.
nbsf Back spaces count files. The tape is positioned on the first block of the file. This is equivalent to
count+1 bsf's followed by one fsf.
asf Specifies absolute space to count file number. This is equivalent to a rewind followed by a fsf count.
If count is specified with any of the following commands, the count is ignored and the command is performed only once.
eom Spaces to the end of recorded media on the tape. This is useful for appending files onto previously written
tapes.
rewind Rewinds the tape.
offline Rewinds the tape and, if appropriate, takes the drive unit off-line by unloading the tape.
rewoffl
status Prints status information about the tape unit.
retension Rewinds the cartridge tape completely, then winds it forward to the end of the reel and back to beginning-
of-tape to smooth out tape tension.
reserve Allows the tape drive to remain reserved after closing the device. The drive must then be explicitly
released.
release Re-establishes the default behavior of releasing at close.
forcereserve Breaks the reservation of the tape drive held by another host and then reserves the tape drive. This com-
mand can be executed only with super-user privileges.
erase Erases the entire tape. Caution: Some tape drives have option settings where only portions of the tape may
be erased. Be sure to select the correct setting to erase the whole tape. Erasing a tape may take a long
time depending on the device and/or tape. Refer to the device specific manual for time details.
config Reads the drives current configuration from the driver and displays it in st.conf format. See st(7D) for
definition of fields and there meanings.
EXIT STATUS
0 All operations were successful.
1 Command was unrecognized or mt was unable to open the specified tape drive.
2 An operation failed.
FILES
/dev/rmt/* magnetic tape interface
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO tar(1), tcopy(1), ar.h(3HEAD), environ(4), attributes(5), mtio( 7I), st(7D)BUGS
Not all devices support all options. Some options are hardware-dependent. Refer to the corresponding device manual page.
mt is architecture sensitive. Heterogeneous operation (that is, SPARC to x86 or the reverse) is not supported.
SunOS 5.10 1 Sep 2004 mt(1)