• Post Reply Bookmark Topic Watch Topic
  • New Topic

i have little problem understand a line  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

a split it in pieces and i have this :
cut : read
-d : directory
' ' : i dont know here ,maybe want to refer to the file .no idea
-f7: -f i know is file.7 i dont know .
"$file" : $ we write first this and after the variable .We put " " because we want to take exactly the variable as it is.
| :
sed : the way to make changes on a file
-r : ERE
' ' : to refer to sed what it should do
/. : it starts with /.
[/]$ : $ that means the end of the word .he use [/] to take only the /
: i have no idea why he has space here
s/ : i dont know ,but something to do all this.(maybe refers to command subsitute but i am not sure on theory i didnt see /s just s
[/]$ : again the same as i discribe it previously
// : i dont know
sort : lets say like bubblesort,invertion sort to make it sort example a,b,c,d..
uniq -c : no idea what it is
sort -n : the sort to be in a line
sed- n '$p' : that means to find the variable p
|sed '
s/ : logic it ends here the s/
.* : what ever it can be digit or word
//' :it ends? no idea
Its too big and i cant understand it guys all
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:

The best way to analyze this is to break it down command-by-command, then look at each command and associated arguments and understand what it doing. Try each command your self to make sure you understand what it is does.

cut -d ' ' -f7 "$file"
sed -r '/.[/]$/ s/[/]$//'
sort
uniq -c
sort -n
sed -n '$p'
sed 's/.*//'

Use man or the command's help option to get details for each command. For example:
   man uniq
   uniq --help
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ron McLeod wrote:
ekte spiriopoulos wrote:

The best way to analyze this is to break it down command-by-command, then look at each command and associated arguments and understand what it doing. Try each command your self to make sure you understand what it is does.

cut -d ' ' -f7 "$file"
sed -r '/.[/]$/ s/[/]$//'
sort
uniq -c
sort -n
sed -n '$p'
sed 's/.*//'

Use man or the command's help option to get details for each command. For example:
   man uniq
   uniq --help
thanks a lot .I didnt think this
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!