Sponsored Content
Full Discussion: Help with system command
Top Forums Shell Programming and Scripting Help with system command Post 302771540 by Jotne on Thursday 21st of February 2013 01:49:29 AM
Old 02-21-2013
Code:
output=$(grep RESTART test|wc -l)
echo "output is $output"
output is 8

I do get 8 for this code. I guess you did count one wrong.

Code:
awk '/RESTART/ {c++} END {print "output is",c}' test
output is 8


Last edited by Jotne; 02-21-2013 at 02:55 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

using system cp command in C program

Hi i used the following code to copy a directory from a source location to dest. argv contains the source loc i/p by the user. strcpy(source,argv); strcpy(dest,"/home/MainServer/Job_dir/"); system("cp -r $source $dest"); it complies properly but during execution of the program it... (2 Replies)
Discussion started by: mridula
2 Replies

2. Shell Programming and Scripting

perl - system command

Can this be done without using te system command? I have a directory with a large number of files in it, but I am interested in only the 8 most recent. The directory looks like -rw-rw-rw- 1 adsm adsm 13412 Sep 22 08:31 events_dump_09222005.csv.gz -rw-rw-rw- 1 adsm adsm ... (5 Replies)
Discussion started by: reggiej
5 Replies

3. Programming

system command

Hi In my code am openeing a mozilla in Solaris with some url using sytem(url) this is working fine for most of the urls but for url of type- www.abc.com?action=p&a=23 it is passing only www.abc.com?action=p to the browser & thus the url is not opening properly. Why is system command... (7 Replies)
Discussion started by: nimishm
7 Replies

4. Shell Programming and Scripting

Need Help w/PERL system command

Hi, I'm wanting to run an nslookup, dig or whatever to check for the existence of a printer. The PERL script will display the results on the screen, but I can't figure out how to capture the result & test the value. Any ideas will be greatly appreciated!!! Thank You (1 Reply)
Discussion started by: lorik
1 Replies

5. Programming

system() command

hello everybody! i write this following command: system ("time (md5sum ./a.out)>log 2>&1"); as a part of a c program. but it printf the following error: sh: Syntax error: word unexpected (expecting ")") can anybody tell me why? thanx in advance (6 Replies)
Discussion started by: nicos
6 Replies

6. Shell Programming and Scripting

system command within awk

I was trying commands within awk. i got stuck here. i take 2 files. cat input first second third fourth fifth sixth seventh eighth ninht tenthcat add *************** Nirbhay ***************i run the command awk '{ if ( NR == 5 ) { print system("cat add") "\n" $0 } else {... (4 Replies)
Discussion started by: nirbhay
4 Replies

7. AIX

printing system with the command lp -d

Hello.. Plz, Any one can help me ? when I execute a printing system with the command lp -d<name of printer>, no result with all printers. I have verified the three processes : qdaemon, lpd, writesrv (No problem). thank's (0 Replies)
Discussion started by: okbainf
0 Replies

8. UNIX for Dummies Questions & Answers

System command

Hello All, I am trying to run this system command from batch file..... my @filename = ( 'cleartool', 'find', '. -type', 'f', '-ver','lbtype_sub(baseline name)', '-print' ); system(@filename); But while executing the batch it is throwing this error: cleartool: Error: Pathname not found:... (1 Reply)
Discussion started by: suvenduperl
1 Replies

9. Programming

Question about system command in C

The man system says During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored. What does this mean? And if i am making a function that does what system does how do i write this signal stuff? (19 Replies)
Discussion started by: omega666
19 Replies

10. Shell Programming and Scripting

System Command dies even when command gets executed successfully

Hi I have created a perl script & running it using Linux machine. I want my script to die when system command is unsuccessful but script is dying even when system command gets executed successfully. :wall: I am using the command below :- system($cmd) || die "FAILED $!"; print "Hello"; ... (2 Replies)
Discussion started by: Priyanka Gupta
2 Replies
GST-CONVERT(1)							   User Commands						    GST-CONVERT(1)

NAME
gst-convert - Smalltalk syntax converter and beautifier DESCRIPTION
Usage: gst-convert [OPTION]... [INFILE [OUTFILE]] gst-convert [OPTION]... -o|--output OUTFILE INFILES OPTIONS
-q, --quiet don't show any message -v, --verbose print extra information while processing -f, --format=FORMAT convert from given input format (supported formats are gst, gst2, sif, squeak) -F, --output-format=FORMAT convert to given output format (supported formats are gst, gst2, squeak) -C, --class=REGEX convert only classes matching REGEX -C, --class=+REGEX in addition, convert classes matching REGEX -C, --class=-REGEX do not convert classes matching REGEX -c, --category=REGEX convert only classes whose category matches REGEX -c, --category=+REGEX in addition, convert those whose category matches REGEX -c, --category=-REGEX do not convert classes whose category matches REGEX -r, --rule='CODE->REPL' look for CODE and replace it with REPL -o, --output OUTFILE concatenate multiple input files into a single converted output file --help display this message and exit --version print version information and exit SEE ALSO
The full documentation for gst-convert is maintained as a Texinfo manual. If the info and gst-convert programs are properly installed at your site, the command info gst should give you access to the complete manual. gst-convert version 3.2.4 December 2011 GST-CONVERT(1)
All times are GMT -4. The time now is 12:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy