10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Trying to do so
echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
2. Shell Programming and Scripting
Sometimes it is handy to protect long scripts in C++.
The following syntax works fine for simple commands:
#define SHELLSCRIPT1 "\
#/bin/bash \n\
echo \"hello\" \n\
"
int main ()
{
cout <<system(SHELLSCRIPT1);
return 0;
}
Unfortunately for there are problems for:
1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies
3. Shell Programming and Scripting
So I'm back once again beating my head off a wall trying to figure out how to get this to work.
My end goal is to take input such as what's below, which will be capture in real time with a tail -f from a file or piped output from another command:
... (5 Replies)
Discussion started by: ShadowBlade72
5 Replies
4. Shell Programming and Scripting
I'm a little stuck and would be grateful of some advice!
I have three files, two of which contain reference data that I want to add to a line of output in the third file. I can't seem to get awk to print array contents as I would expect.
The input files are:
# Input file
AAA,OAA,0313... (2 Replies)
Discussion started by: maccas17
2 Replies
5. UNIX for Dummies Questions & Answers
Okay, I've made threads on extracting fields and comparing strings in separate files in .csv's. I've written the following code with intentions of learning more.
I just want this one question answered: How can I assign fields from a file(comma separated) to variables?
My goal is to check... (0 Replies)
Discussion started by: chickeneaterguy
0 Replies
6. Shell Programming and Scripting
Hi,
I have the following data in a file for example:
Name="Fred","Bob","Peterson","Susan","Weseley"
Age="24","30","28","23","45"
Study="English","Engineering","Physics","Maths","Psychology"
Code="0","0","1","1","0"
Name="Fred2","Bob2","Peterson2","Susan2","Weseley2"... (14 Replies)
Discussion started by: james2009
14 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I have a problem assigning variables to script.I have a script in which i have a while loop now i have to assign some values obtained to an array which will be used later in the script.Can anyone help how to do that.
At present my scrot looks like:
co=0
pco=0
co=`cat /tmp/highcpu... (4 Replies)
Discussion started by: usha rao
4 Replies
8. Shell Programming and Scripting
Hi, I've written the following code to manipulate the first 40 lines of a data file into my desired order:
#!/bin/awk -f
{ if (NR<=(4)){
a=a$0" "}
else { if ((NR >= (5)) && (NR <= (13))) {
b=b$0" " }
else {if ((NR >= (14)) && (NR <= (25))){
c=c$0" "}
... (5 Replies)
Discussion started by: catwoman
5 Replies
9. Shell Programming and Scripting
now its owkring - thanks fo rthe help all . (7 Replies)
Discussion started by: fusionX
7 Replies
10. Shell Programming and Scripting
Been struggling with a problem, I have been trying to do this in awk, but am unable to figure this out, I think arrays have to be used, but unsure how to accomplish this.
I have a input file that looks like this:
141;ny;y;g
789;ct;e;e
23;ny;n;u
45;nj;e;u
216;ny;y;u
7;ny;e;e
1456;ny;e;g... (3 Replies)
Discussion started by: craigsky
3 Replies