10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all, I have two files which are cmd and disk.
`$cat cmd
lsdev | grep -iw`
`$cat disk
hdisk2`
Now I want to use the contents of both the files in a way such that `lsdev | grep -iw` command works for hdisk2 when I write the following script:
`!#/bin/sh
cmd1="$( sed -n... (4 Replies)
Discussion started by: ravi.trivedi
4 Replies
2. Shell Programming and Scripting
Hi,
I've tried searching through the forum but I've drawn a blank so i'm going to post here. I'm developing a number of checks on a CSV file, trying to find if any are greater than a max limit. I'm testing it by running it from a command line.
The file I'm testing has 8 records. When I... (3 Replies)
Discussion started by: Tmart
3 Replies
3. Programming
Hi,
I have this following code which gives me error when compiling. The problem is happening at the point where I create a const_iterator inside the overloaded insertion operator (i.e) operator << () function. The template argument version of set is not correct I guess. Could anyone please pitch... (3 Replies)
Discussion started by: royalibrahim
3 Replies
4. UNIX for Dummies Questions & Answers
Hello everyone,
on the man page of "magic(5)"
There is explanation
"&, to specify that the value from the file must have set all of the bits that are set in the specified value" .
My question is that what is the difference between '&' and equal operator '=' ? I tested it with file... (6 Replies)
Discussion started by: segmentation
6 Replies
5. Shell Programming and Scripting
Hi,guys:
I want to use c to implement a pipe. For example:
ps auxwww | grep fred | more
I forked three child processes. Each is responsible for each command, and pipe to next one.
for(i=0;i<2;i++)
pipe(fd)
if(child==1) // child 1
{
close(1)
dup2(fd,1)
close(fd)
}... (3 Replies)
Discussion started by: tomlee
3 Replies
6. UNIX for Dummies Questions & Answers
I get the following error
./get_NE05: line 42:
while
do
echo ${STRING_NAME}
J=1
if ; then
EXT=0$I
else
EXT=$I
fi
while
do
echo $I-$J
#calculating last occurrence
OCCURRENCE=`grep -io "${STRING_NAME}"... (3 Replies)
Discussion started by: f_o_555
3 Replies
7. Shell Programming and Scripting
I have a string of commands I am piping some data through and I want to allow command line switches to select which commands are used. I want to do something like this: OPTION="| command3"
command1 -a -b c.txt | command2 -d -e $OPTION >result.txt
I want to do it that way because OPTION may be... (1 Reply)
Discussion started by: KenJackson
1 Replies
8. Programming
Could anyone tell me whats wrong whit this piping? the commands that they execute are correct. the command I am trying is ls|wc. Both processes go to the right if statement.
for(i=0;i<argc;i++){
if(i==0&&argc>1){//first command
if(pipe(pipa1)==-1)
... (2 Replies)
Discussion started by: isato
2 Replies
9. Shell Programming and Scripting
Hello folks,
I am facing a problem with the following korn shell script snippet:
ftp -n -i -v <<EOF
print -p open $CURR_HOST
print -p user $USER $PASSWD
print -p binary
print -p cd /mydir/subdir/datadir
print -p get $FILENAME
print -p bye
EOF
exit
It gives me the following... (3 Replies)
Discussion started by: Rajat
3 Replies
10. Programming
#include <iostream.h>
class test
{
private:
int i;
public:
inline test(int m)
{
i = m;
}
inline int get_i()
{
return i;
}
};
int main()
{
test * a = new test(2); (3 Replies)
Discussion started by: xbjxbj
3 Replies