Search Results

Search: Posts Made By: Max89
7,412
Posted By Max89
Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d
This is the code:

while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done

I read a command on every loop an execute it.
I check if the string equals the word stop to...
8,778
Posted By Max89
Thank you all,but I don't understand 'NR==' ...
Thank you all,but I don't understand 'NR=='

Should I put there $3(the argument I want to compare every line)?

awk '$3=='$i temp.txt
awk '$3'$i temp.txt
Both doesn't work.
8,778
Posted By Max89
grep a specific line from a file
Is there a way to grep only one line from a file listing name of files?
If I use head -1 it's ok(the first line only)
If I use head -2 it's not good because I have already checked the first line.
...
2,811
Posted By Max89
Order file by lines
My script(3 arguments $1 = folder,$2 extension,$3 string) should do the following things:
-Enter in the folder of $1(if exists).
-Put ls *.$2 > temp.txt ( I use a temp file to store the result of...
2,902
Posted By Max89
I donwloaded notepad and save the .txt file in...
I donwloaded notepad and save the .txt file in unix format instead of pc format and now it works.
2,902
Posted By Max89
Yes you are right,but it doesn't work anyway. ...
Yes you are right,but it doesn't work anyway.
Maybe I should save in linux format?
2,902
Posted By Max89
cygwin script problem windows
I'm using cygwin to make some scripts,but I have the following problem.
If I create a simple script like this one:

if [ $# -ne 2 ]
echo "Error"
exit 1
fi
echo "`expr $1 + $2`"

I obtain...
4,719
Posted By Max89
What does awk actually do? I read that combines...
What does awk actually do?
I read that combines grep and sed commands but I don't understand this '$1=" "'.
It works only if I don't create a script.
What should I do to make a working script of...
4,719
Posted By Max89
Thank you. But I don't know how write the...
Thank you.
But I don't know how write the command.
grep "ls" history doesn't work.
4,719
Posted By Max89
Counting commands frequency
I'd like to create a script that keeps track of the commands used.
For example:

count ls ps

and from now on whenever I use ls or ps a counter is increased.
I want that after the command...
Showing results 1 to 10 of 10

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