Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

print the content of file according to the size of line

#!/bin/bash

while read x; do 
	## print the number of words and then the line it self 
    ## add it to a temp file 
	echo "$(echo $x | wc -w) $x" >> temp.txt
done < $1 ## expecting an argument passed 

# sort in numerical order, and then print from the second field forward  
sort -n temp.txt | cut -f2- -d" "

Comment

PREVIOUS NEXT
Code Example
Shell :: download marven ubuntu 
Shell :: Ubuntu software in 22.04 store does not use system theme 
Shell :: webgpu chrome linux 
Shell :: create multiple files on Linux in sequence through the terminal 
Shell :: compilation failed for package in r ubuntu 
Shell :: how to zip current directory in linux 
Shell :: linux copy file 
Shell :: install vue-router for vue 2 
Shell :: grep print next line after match 
Shell :: ionice 
Shell :: grep -w flag 
Shell :: git change name 
Shell :: exception: unable to run "adb", check your android sdk installation and android_sdk_root environment variable: 
Shell :: snap cli install bitwarden 
Shell :: nextcloud .step file 
Shell :: git push submodule changes to fork 
Shell :: how to use verifly in hardhat 
Shell :: how know snap package size 
Shell :: tree command in hpc 
Shell :: bash store directory list array 
Shell :: dnf install specific version 
Shell :: github action and netlify deploy 
Shell :: ubuntu find file mask 
Shell :: ta-lib linux 
Shell :: fedora doesnt recognise hard disk 
Shell :: delete the branch with the old name on the remote repository 
Shell :: app not installed app appears to br corrupt in android studio 
Shell :: linode aapanel info location 
Shell :: git init bare initialize empty git repository 
Shell :: git add symlink alias link file folder 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =