Skip to main content
Remove some trailing semi-colons
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"; "$file"
        perl -i -p -e 's/output/inout/g' "$file";"$file"
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file";"$file"
        perl -i -p -e 's/assign.*\n//g' "$file";"$file"
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file";"$file"
    done
fi

Or even more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                   s/wire.*\n/tran\(i0,\ o\);/g; 
                   s/assign.*\n//g' ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*
fi

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"; 
        perl -i -p -e 's/output/inout/g' "$file";
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file";
        perl -i -p -e 's/assign.*\n//g' "$file";
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file";
    done
fi

Or even more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                   s/wire.*\n/tran\(i0,\ o\);/g; 
                   s/assign.*\n//g' ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*
fi

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"
        perl -i -p -e 's/output/inout/g' "$file"
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file"
        perl -i -p -e 's/assign.*\n//g' "$file"
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file"
    done
fi

Or even more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                   s/wire.*\n/tran\(i0,\ o\);/g; 
                   s/assign.*\n//g' ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*
fi
added 288 characters in body
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"; 
        perl -i -p -e 's/output/inout/g' "$file";
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file";
        perl -i -p -e 's/assign.*\n//g' "$file";
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file";
    done
fi

Or even more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                   s/wire.*\n/tran\(i0,\ o\);/g; 
                   s/assign.*\n//g' ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*
fi

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"; 
        perl -i -p -e 's/output/inout/g' "$file";
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file";
        perl -i -p -e 's/assign.*\n//g' "$file";
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file";
    done
fi

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"; 
        perl -i -p -e 's/output/inout/g' "$file";
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file";
        perl -i -p -e 's/assign.*\n//g' "$file";
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file";
    done
fi

Or even more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                   s/wire.*\n/tran\(i0,\ o\);/g; 
                   s/assign.*\n//g' ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*
fi
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

The $(foo) construct will run the command foo and replace $(foo) with the output of running foo. You want a glob, that's not a command. What you're doing is attempting to run all files called ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*. All you need is:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g' "$file"; 
        perl -i -p -e 's/output/inout/g' "$file";
        perl -i -p -e 's/wire.*\n/tran\(i0,\ o\);/g' "$file";
        perl -i -p -e 's/assign.*\n//g' "$file";
    done
fi

Or, more simply:

if [ -f zebu.work.post_opt/ZEBU_CTO_FT_MOD.v ]
then
    for file in ./zebu.work.post_opt/ZEBU_CTO_FT_MOD*;
    do
        perl -i -p -e 's/input/inout/g; s/output/inout/g; 
                       s/wire.*\n/tran\(i0,\ o\);/g; 
                       s/assign.*\n//g' "$file";
    done
fi