10-27-2011
You already said it yourself: Use grep. The man page reveals -q for quiet mode and if you could send anything else you do not need to > /dev/null 2>&1.
Next you can check what the content of $? is and decide what to do.
This is all you need - there are usually several ways. Just try it out and play around with it. If you get stuck at a specific point, ask again, but do not expect to get a complete solution without showing own effort.
Thanks for your understanding.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
Im fairly new to scripting and am having a noobish issue. Ive got a script that checks for certain directories and if they dont exist, prompts the user to do a mkdir. heres trouble spot in the script:
cat dirlsttemp.dat | while read dir; do
echo "$dir does not exist, would you... (3 Replies)
Discussion started by: rdudejr
3 Replies
2. Shell Programming and Scripting
HI ,
I have to write a script for some testing , which will telnet to a device and execute some TL1 commands..
Does any one knows how to execute TL1 commands through a script
Thanks in advance
Binu (1 Reply)
Discussion started by: msbinu
1 Replies
3. Shell Programming and Scripting
Hi, i would like to create a script that shuts down the system if the power fails, basicly the solaris box would load the script at startup.
Ping 192.168.1.100 every 20 secs
If cannot get responce 3 times in a row send init 0 to the system.
Simple but effective, as 192.168.100.1 wont be on... (39 Replies)
Discussion started by: ringofsteel
39 Replies
4. Shell Programming and Scripting
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Discussion started by: hariza
4 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide.
ls -aLl /bin | grep "\(x\)"
Which works, just highlights 'x' where ever, when ever.
I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies
6. Shell Programming and Scripting
Hi All, I need to grep few files which has words like the below in the file name , which i want to put it in a file and and grep for the files which contain these names and move it to a new directory ,
full file name -C20091210.1000-20091210.1100_SMGBSC3:1000... (2 Replies)
Discussion started by: anita07
2 Replies
7. Shell Programming and Scripting
Hi All,
I'm a newbie here, I'm just wondering how can i connect and login to TL1 using Unix? is it possible?
Please advise,
THanks,
---------- Post updated at 03:33 PM ---------- Previous update was at 03:09 PM ----------
is there anyone know how to connect and login in TL1 using... (2 Replies)
Discussion started by: nikki1200
2 Replies
8. UNIX for Dummies Questions & Answers
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Discussion started by: jcdole
1 Replies
9. Shell Programming and Scripting
i have this line of code that looks for the same file if it is currently running and returns the count.
`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`
basically it is assigned to a variable
ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
10. Shell Programming and Scripting
HI Everyone,
I have TL1 script which takes the temperature of a CISCO equipment through TELNET now i need to save the output of the command to a csv file .
Like this is the output
> RTRV-SHELFSTAT:AB1S2a::1;
AB1S2a 2016-02-03 22:29:39
M 1 COMPLD
... (2 Replies)
Discussion started by: adgjmpt
2 Replies
LEARN ABOUT REDHAT
dvcont
DVCONT(1) General Commands Manual DVCONT(1)
NAME
dvcont - send control commands to DV cameras
SYNOPSIS
dvcont <command1> [ <command2> ... ]
DESCRIPTION
dvcont is a command line tool to send control commands via an IEEE1394 link to a device that implements the AV/C specifications by the 1394
Trade Association. Or for the non-techies: dvcont lets you remote control your DV camera via a Firewire cable. The following commands are
understood:
dev <number>
Select device number on chain to use. (dvcont tries to automatically detect the camera. Use the dev command BEFORE any other com-
mands for manual control.)
play Tell the camera to play. If already playing, it toggles slow-motion.
reverse
Tell the camera to play in reverse. If already playing, it toggles slow-motion.
trickplay < -14 to +14 >
Tell the camera to play at various speeds. 0 = forward play, -14 = fastest reverse, -8 = 1X reverse, -1 = slowest reverse, 1 =
slowest forward, 8 = 1X forward, 14 = fastest forward. (Not supported by all cameras.)
stop Tell the camera to stop playing.
rewind Tell the camera to rewind. (Use in stop or play mode.)
ff Tell the camera to fast forward. (Use in stop or play mode.)
pause Tell the camera to toggle pause play.
next Tell the camera to go to the next frame. (Use in pause mode.)
nextindex
Tell the camera to search for the next scene. (Use in pause or play mode.)
prev Tell the camera to go to the previous frame. (Use in pause mode)
previndex
Tell the camera to search for the previous scene. (Use in pause or play mode)
record Tell the camera to record. (Use with caution!)
eject Tell the camera to eject the tape. (Not supported by all cameras.)
timecode
Report the timecode on tape in the format HH:MM:SS:FF.
status Report the status of the device.
verbose
Tell the program to tell you debug info.
version
Tell the program to tell you the program version.
help Tell the program to show you a help screen.
AUTHORS
dvcont was written by Jason Howard <jason@spectsoft.com> and Dan Dennedy <dan@dennedy.org>. This man page was written with the help of
help2man by Daniel Kobras <kobras@debian.org> for the Debian GNU/Linux distribution (but may be used by others). Updated by Dan Dennedy
<dan@dennedy.org>.
dvcont September 2001 DVCONT(1)