Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I want to use a 2-dimensional array element in the sed command (using system() function) inside a C program. What should be the syntax for that..?? I tried the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    2

    Smile Regarding sed command in C program


    Hello,
    I want to use a 2-dimensional array element in the sed command (using system() function) inside a C program. What should be the syntax for that..??

    I tried the following code but its showing an error.

    1. "system("sed -n '/"${ben[0][$j]}" s/h/"${string1[]}"/' parent > f"$i"");"

    2. "system(" sed -n '"${ben[0][$j]}" w temp' f"$i" ; temp1=$(awk '{printf $3}' temp) ; sed '/"$temp1"/s/"$bond0"/"$bond1"/' f"$i" ; rm temp");"

    Please help me out.

    Thank you in advance.

  2. #2
    Just Joined!
    Join Date
    Jul 2012
    Posts
    2
    Here $i, $bond0, $bond1 are all variables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •