awk '{print $NF}' prints the last field, but do I grep a path which is somewhere within each line that starts with a charecter //
for e.g., following line is one of the lines of my file. I need to just extract the path //mymachine/myfolder/mysubfolder
ignoring all other contents of each line...
It all depends on the tool you use. Just add all the vhdl files into your project and the tool will take care of the files, and their paths, irrespective of whether both the package file and the main file are in the same directory or not.
You probably have to just add the package file into...
You can use WHEN-ELSE construct for this.
If temp is your output signal, then use the following code.
temp <= "00001001" when mode = '0' else "10010010";
If the mode can take more values, then may be you can use the ROM coding style.
Case (mode) is
when "0000" temp <= "0001";
when...
Hi,
The following command appends the contents of myfil.txt to each *.scr file in each folder under the directory maindir.
find maindir -name '*.scr' | while read f; do cat /path/to/myfil.txt >> "$f"; done
My question is, how can we "find and replace a string" in all the *.SCR files in each...
Hi,
I have a huge output file which contains data about some users.
Report for each user starts with the following line in the file.
Detailed Report for User: <user name>
....some data...
Detailed Report for User: <USER NAME I AM INTERESTED IN>
....some other data...
Detailed Report...
Hi,
I have to append the content of the file myfil.txt to each *.scr file found in every sub-folder under the main directory "maindir"
Each *.scr file has a unique name. Someone in the forum suggested the following command:
find maindir -name *.scr -exec cat /path/to/myfil.txt >> {} \;
But...
Hi,
Can somebody point me why I get "expression syntax error" for the following Korn shell script?
x=`awk '/Info: .*.abc/{print $2}' results.log`
y=`awk '/Info: .*.txt/{print $2}' results.log`
z=`awk '/Total: /{print $2}' results.log`
if [ $x == $z ];
then
echo "match" >>...
Is there a easy way to do the following in (Korn) shell?
My text file contains lines similar to the following, each on a different line:
# reg1.inst_abc[0].a unmatched
# reg1.inst_abc[1].a unmatched
....
....
.....
# reg1.inst_abc[n].a unmatched
# inst_abc[0].a unmatched
#...
Hi,
Someone please help me to correct the 'expression syntax error' in the following Korn-shell script:
if [ [ `grep -i "Info: .*.txt" results.log` ] && [ `grep -i "Total: " results.log` ] ]
then
x=`awk '/Info: .*.tam/{print $2}' results.log`
y=`awk '/Total: /{print $2}' results.log`...
Hi,
Someone please help me to find out the command/code which can check if a particular file has been created.
I run a TCL script which will create a file fil.txt during the execution. In the same script I need to check for the presence of fil.txt and if it does exist, then exit the script or...
Hi,
My text file contains something like following:
adsdfaddfd <some path1>
adlfjakflafaf /<some path2>
adfabzlhzxhledfdfe3dfstet <some path3>
d3dfstet <some other path>
How do I print or redirect only the path information to another file?
That is, each line in second file should...
Hi,
My text file contains something like following:
adsdfaddfd <some path1>
adlfjakflafaf /<some path2>
adfabzlhzxhledfdfe3dfstet <some path3>
d3dfstet <some other path>
How do I print or redirect only the path information to another file?
That is, each line in second file should...
Hi,
I am trying to remove blank lines from a report by doing
grep -v "^$" file1 > file2
such that file2 doesn't contain blank lines.
Although it works on most of the blank lines, I still see few blank lines such as the one in the code. I am wondering why it doesn't remove *ALL* blank lines in...
Hi,
I have a file abc.prj in each of many subdirectories.
I need to append the contents of myfil.txt to every abc.prj file in the same subdirectories.
Can somebody please help me out on this?
The structure is as follows:
Main ---|
|subdir1 --> abc.prj
|subdir2 --> abc.prj...
Hi,
I have a file abc.prj in each of many subdirectories.
I need to append the contents of myfil.txt to every abc.prj file in the subdirectories.
Can somebody please help me out on this?
The structure is as follows:
Main ---|
|subdir1 --> abc.prj
|subdir2 --> abc.prj
|subdir3 --> abc.prj...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.