Search Results

Search: Posts Made By: kidSandy
2,352
Posted By kidSandy
Yep, you are correct, i missed $ in the example...
Yep, you are correct, i missed $ in the example :( .

here is the corrections for 2nd example
IFS=$'\n' ##blank lines preserved?
for line in $(cat $FILENAME);do
echo "each line $line"...
2,352
Posted By kidSandy
FILENAME="file.txt" #while loop while read...
FILENAME="file.txt"
#while loop
while read line; do
echo "each line $line"
done < $FILENAME


##For Loop
for line in (cat $FILENAME);do
echo "each line $line"
done
...
4,002
Posted By kidSandy
If really don't want to use -v option with egpre...
If really don't want to use -v option with egpre or grep to exclude the lines containing CAT|MAT|DAT strings, then as per my knowledge the best option to use is sed

sed '/string/d' filename
...
2,135
Posted By kidSandy
I have modified the script on the same below...
I have modified the script on the same below link, OR condition(|) was missing for one of the statement - copy paste type error, apologies for the same. Tested working very well
Perl - Need a Perl...
2,135
Posted By kidSandy
I have posted Perl code you are looking in the...
I have posted Perl code you are looking in the below link, can refer the same
Perl - Need a Perl code for the below input and output...
5,456
Posted By kidSandy
Yes, we can build XML file by using Perl module...
Yes, we can build XML file by using Perl module XML::Writer,
here is the link for more details with script
XML - Convert CSV file into XML file in Perl...
2,111
Posted By kidSandy
check this unix - Create symbolic link into a...
check this
unix - Create symbolic link into a directory pointing into another directory...
1,707
Posted By kidSandy
Can do this using for loop in directory for...
Can do this using for loop in directory
for file in `ls *files.txt`
do
newfile=$file"_new"
cat $file | sed 's/klp//g' >$newfile
done
19,850
Posted By kidSandy
find . -mtime +5 | xargs ls -ltr ...
find . -mtime +5 | xargs ls -ltr

alternatively

find . -mtime +5 -exec ls {} \;
981
Posted By kidSandy
.
We can pass variable to Awk, refer link
path="xyzabc"

awk -v dir="$path" '{print $4 " " $3 " " dir}'http://exceptiongeek.com/questions/question/1/How-to-use-shell-variables-in-awk-script
4
awk
780
Posted By kidSandy
echo 2014120320141123 | awk '{print...
echo 2014120320141123 | awk '{print substr($0,length-6,length)}'
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy