08-06-2008
One more query......
I am trying to assign a value to a variable but getting error....
IP_ADDR=${`grep 'I.P. Address' /install/cfgdist/`uname -n`.cfg | cut -d : -f 2| cut -d . -f 1-3| sed s/" "//g`}
I am using this script to grep first three octets of an IP address from a file and assign the value to IP_ADDR....but I am not able to assign the value to the variable...
Please some one help.
Regards,
Abhishek
10 More Discussions You Might Find Interesting
1. Linux
Hi,
iam presenting the input text file format.Of this i need the character count of the number of characters present in each file.The attached file is a combination of 3 text file.each text file starts at record 1 - 34, then the next tetx file starts. What i need is the character count of each... (1 Reply)
Discussion started by: sethunath
1 Replies
2. Shell Programming and Scripting
Hi All,
this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem.
#!/bin/bash
echo "Enter the character"
read a
case $a in
)... (2 Replies)
Discussion started by: johnray31
2 Replies
3. Shell Programming and Scripting
The following Script takes each extension and determine what category it
belongs and then moves it into a directory based on the extension.
(for eg. 1.sh, 5.sh, 9.sh together; 4.csh, 120.csh, 6.csh together and 7.ksh, 2.ksh, 59.ksh together) and moves them to their respective directories viz.... (2 Replies)
Discussion started by: marconi
2 Replies
4. Shell Programming and Scripting
Hi Buddies,
The following is shell scripts which was borrowed from linux box for load average check. it runs good.
(this structure is simple, when load average is too high, it will send alert to user)
#!/usr/bin/ksh
# Set threshold for 1, 5 and 15 minture load avarage
# configured for... (4 Replies)
Discussion started by: GreatJerry
4 Replies
5. Shell Programming and Scripting
There are two fields actually one is server name and the other one is Time.
Based on time, there are 8 columns and these will be updated with the flag 1 if at all if there is any server name.
Time
Server name
15 to 18
18 to 21
21 to 24
00 to 03
03 to 06
06 to 09
09 to 12
Server... (3 Replies)
Discussion started by: venkatesht
3 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I am using korn shell sun solaris 10
What i need is i have to grep one file and if there are any finding then i have set one flag. otherwise continue
Please help
Regards
Arun (9 Replies)
Discussion started by: annyarun
9 Replies
7. Shell Programming and Scripting
Hello Forum members,
Have a nice day.
I have to write a script for the following below scenario.
There are 3 applications located in home directory(ie xyz/app) which have multiple directories and files of diff format(.sh,log,other formats).
Case 1: I have to find the hardcoded... (8 Replies)
Discussion started by: rajkumar_g
8 Replies
8. UNIX for Dummies Questions & Answers
I have a scenario where i need to look for files of these kind
filename.log.0
filename.log.1
if the files are present, then no action is to be taken, if not found,
then it shud create/touch files with the same name.
so can anyone help constructing the script for me..appreciate ur help.
... (5 Replies)
Discussion started by: win4luv
5 Replies
9. Shell Programming and Scripting
Hi Guys,
Sorry to bother everyone again here, but I ran into a small problem that has been after me for some time now.
I have a file called file1.txt and has following content -
/folder1/fold/folder 10k
/folder167fold/folder 10MB
/folder2/fold/folder 10G
etc..
etc..
... (1 Reply)
Discussion started by: rockf1bull
1 Replies
10. Shell Programming and Scripting
Hi,
I am new to UNIX and have an issue.
I need to check that whether a perticular file name exists or not. I wan to do that in loop to avoid number of IF statements.
I need to check that
if file10.txt exists rename that to file11.txt.
if file9.txt exists rename that to file10.txt.
:
:
if... (5 Replies)
Discussion started by: unankix
5 Replies
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)