Search results

  1. R

    deleted post

    post deleted.
  2. R

    Merge two files based on similar line values.

    try using gawk.
  3. R

    Merge two files based on similar line values.

    awk ' { gsub("[+][|][+]-+", ""); gsub("[|][|]", "|")} /[+]$/ {l=length($0)} ! /[+]$/ && l {$0=sprintf("%-s%*s|", $0, l-length-1, " ")} 1 ' final
  4. R

    Object Classes

    account bootableDevice device ieee802Device ipHost ipNetwork ipProtocol ipService mailRecipient nisMap nisNetgroup nisObject oncRpc organization posixAccount posixGroup shadowAccount there could be more.
  5. R

    <SOLVED> just how many commands are there in linux? ls -1 /bin /sbin /usr/bin | nl???

    echo "$PATH:/bin:/sbin:/usr/bin" | tr ':' '\n' | sort -u | while read dir do [[ -d "$dir" ]] && { find "$dir/" -type f -executable 2>/dev/null } done | nl
  6. R

    find and replace string with regexp in multiple files using ack

    make sure any paths or names used are wrapped in quotes if "*" (asterisks) are included.
  7. R

    Merge two files based on similar line values.

    awk -F"|" 'NR==FNR {a[$2]=$3; next} a[$2] {$0=$0 a[$2] FS} 1' file2 file1
  8. R

    ls -l | grep

    ls -1 essai-grep/* | grep -E /[Ff]raise | xargs ls -l
  9. R

    Grep with number of caractere

    ls -1 ????? 2>/dev/null
  10. R

    SED command

    ifconfig eth0 | awk '/RX pack/ {print $3}'
  11. R

    find and replace string with regexp in multiple files using ack

    backup code directory first. then try: find code_directory/ -type f -exec sed -i 's/\[\([^]"]*\)\]/["\1"]/g' {} \;
  12. R

    find and replace string with regexp in multiple files using ack

    sed -i 's/\[\([a-zA-Z0-9_]*\)\]/["\1"]/g' file
  13. R

    Pulling grep patterns from a file

    The awk is doing as stated in #1 post: "read out the values one by one in order to give it to grep" The solution on #3 post could return repeat values from the awk (and perform more than one grep for a value) and will also match values like "value21" when searching for "value2".
  14. R

    How can split data on blocks bash?

    #!/bin/bash let c=1 lines=$(cat txt-file | wc -l) while [ $c -le $lines ] do awk 'NR>=l && NR<=l+9' l=$c txt-file (( c = c + 10 )) sleep 3 done
  15. R

    Pulling grep patterns from a file

    awk -F= '!a[$2]++ {print $2}' ~/executables | while read var do grep "\b$var\b" file_to_search done
Top