split a file or return shell variable to a program | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
In the shell I defined the variable k such as: $export k=1 in my bash script file,myFile, for testing, I put echo $k let k+=1 (or this expression k=`expr $k + 1`) echo $k
when I run this script file, it gives me 1 2
the problem is when I called form a C or C++ program, such
system("echo $k");
//this gives 1
system("./myFile");
// this display
// 1
//2
system("echo $k");
//here the problem, it display 1 not 2- : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
[Site Home] [Linux Newbie] [Audio] [Hams] [Kernel Newbies] [Memory] [Util Linux NG] [Security] [Netfilter] [Bugtraq] [Writing Drivers] [Photo] [Yosemite Photos] [Yosemite News] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Samba] [Video 4 Linux] [Git] [Linux Resources] [Fedora Users]
![]() |
![]() |