11-24-2009
thank you folks
All set - works perfect.
thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am giving a grep command, and i am getting the output. i want to store it in a variable
for eg
a = grep '12345' /dir/1/2/log.txt ( the output is number)
b= grep 'basic' /dir/1/2/log1.txt (in this case the output is character)
so how to assign the output of grep to a variable
... (1 Reply)
Discussion started by: vasikaran
1 Replies
2. Shell Programming and Scripting
I want to assign a comment to a veriable
for example my program
head -1 myfile
I want to assıgn output to a variable (1 Reply)
Discussion started by: walnut
1 Replies
3. Shell Programming and Scripting
Hi
I am trying to write a function that needs to be able to assign the last run shell command to a variable. The actual command string itself not the exit code of the command.
I am using the bash command recall ability to do this as follows:
alias pb='ps | grep ash' ... (3 Replies)
Discussion started by: Moxy
3 Replies
4. Shell Programming and Scripting
Hi ,I am trying to assign string to variable ,but it doesn't work
Also could you show me different ways to use grep,(I am trying to get the first,second and first column form file,and I am counting the chars)
let name=`grep "$id" product | cut -c6-20` (25 Replies)
Discussion started by: lio123
25 Replies
5. Shell Programming and Scripting
Hi, wondering if it's been asked before but didn't find matches from google. Basically I have this line:
myvar=$(echo -e "a\tb")
Now somehow the '\t' from the echo output gets replaced with white space and then stored in $myvar.
It creates a problem for me later to use tab as delimiter to do... (2 Replies)
Discussion started by: birddie
2 Replies
6. Shell Programming and Scripting
hi i want to find the size of a folder and assign it to a variable and then compare if it is greater than 1 gb.
i am doin this script, but it is throwing error....
#!/bin/ksh
cd . | du -s | size = awk '{print $1}'
if size >= 112000
then
echo size high
fi
ERROR : (4 Replies)
Discussion started by: Nithz
4 Replies
7. Shell Programming and Scripting
Code
set -x
STATUS="0"
echo $STATUS
for i in `ls -ltr Report*|awk '{ print $9 }'`
do
if
then
flg = "`head -1 "$i" |cut -c 31-33`"
echo `head -1 "$i" |cut -c 31-33`
echo $flg
if
then
echo "having Fun"
STATUS="2"
else
echo "no Fun"
fi
fi (2 Replies)
Discussion started by: Funkeydude
2 Replies
8. Shell Programming and Scripting
Hi Folks,
I am trying to assign a value from the command to a dynamic variable. But I am not getting the desired output.. I am sure something is wrong so i need experts advise.
There will be multiple files like /var/tmp/server_1, /var/tmp/server_2, /var/tmp/server_3, having different server... (6 Replies)
Discussion started by: ganga.dharan
6 Replies
9. UNIX for Beginners Questions & Answers
In the else of the main if condition .
else
set lnk = $(readlink -f <path> | cut -d '/' -f7)
echo "$lnk"
if ]
When I run the above on command line , the execution seems to be fine and I get the desired output. But when I try to assign it to a variable within a loop... (12 Replies)
Discussion started by: sankasu
12 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I am attempting to assign the output of the following command, to two bash variables, var1 and var2 using "read," but it doesn't seem to be working.
# openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}'
vcpus 92
# echo $?
0
# openstack hypervisor... (4 Replies)
Discussion started by: sand1234
4 Replies
LEARN ABOUT DEBIAN
cvssuck
CVSSUCK(1) General Commands Manual CVSSUCK(1)
NAME
cvssuck - inefficient cvs repository grabber using cvs command
SYNOPSIS
cvssuck [-h] [-b] [-s] [-v] [-D debug-option,...] cvsroot [-o output-directory|-O output-base] [-l lock-directory|-L lock-base] module ...
DESCRIPTION
CVSsuck is a mirroring tool for cvs repositories. Unlike other tools such as CVSup or rsync, it uses cvs command to access the repository.
So, it works well with remote repositories without a special server or shell account. However it is inefficient and not perfect because
cvs client/server protocol is not designed for mirroring. If a server provides special way to grab a repository, you shouldn't use CVS-
suck.
OPTIONS
-h prints help message.
-b makes CVSsuck to traverse directories in breadth first. CVSsuck traverses directory in depth first by default.
-s specifies skeleton mode. In this mode, CVSsuck grabs only first revision of the trunk, 1.1, branchpoints, head of branches and
tagged revisions. Note that first two (first revision of the trunk and 1.1) is identical in usual case.
-v makes CVSsuck verbosely. This is same as `-D command,attic,leavetmp'.
-D debug-option,...
specifies debug options. Available debug options are listed by `cvssuck -h'.
-o output-directory
specifies the directory to store grabbed repository. A remote RCS file module/dir/file,v in cvsroot will be stored in output-direc-
tory/dir/file,v.
-O output-base
specifies the base directory to store grabbed repository. A remote RCS file module/dir/file,v in cvsroot will be stored in output-
base/module/dir/file,v. -o and -O is exclusive. The last specified before module is effective. By default, CVSsuck behaves as
that current directory is specified with -O.
-l lock-directory
specifies the directory of CVS style lock.
-L lock-base
specifies the base directory of CVS style lock. -l and -L is exclusive. A lock directory should be specified after an output
directory. The last specified before module after an output directory is effective. By default, CVSsuck assumes a lock directory
is same as output directory.
EXAMPLES
% cvssuck :pserver:anonymous@cvs.m17n.org:/cvs/cvs cvssuck
grabs the module cvssuck in the repository :pserver:anonymous@cvs.m17n.org:/cvs/cvs into the directory cvssuck.
% cvssuck :pserver:anonymous@cvs.m17n.org:/cvs/cvs cvssuck cvs-info
grabs the modules cvssuck and cvs-info.
% cvssuck :pserver:anonymous@cvs.m17n.org:/cvs/cvs -O $HOME/.cvsroot cvssuck
grabs the module cvssuck into $HOME/.cvsroot/cvssuck.
% cvssuck :pserver:anonymous@cvs.m17n.org:/cvs/cvs -O $HOME/.cvsroot -L $HOME/.cvslock cvssuck
grabs the module cvssuck into $HOME/.cvsroot/cvssuck with the lock directory $HOME/.cvslock/cvssuck.
% cvssuck :pserver:anonymous@cvs.m17n.org:/cvs/cvs -o $HOME/.cvsroot/cvs/suck cvssuck
grabs the module cvssuck into $HOME/.cvsroot/cvs/suck.
% cvssuck -s :pserver:anonymous@cvs.m17n.org:/cvs/cvs cvssuck
grabs needy revisions (skeleton) of the module cvssuck.
SEE ALSO
http://cvs.m17n.org/~akr/cvssuck/
cvs(1), rcs(1), cvsup(1), rsync(1)
AUTHORS
Tanaka Akira <akr@m17n.org>.
BUGS
It's inefficient.
It's not perfect because revisions stated as `dead' cannot be retrieved. However it is not observable until the state is changed by `cvs
admin -s'.
25 September 2000 CVSSUCK(1)