Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

shtool-path(1) [debian man page]

SHTOOL-PATH.TMP(1)					      GNU Portable Shell Tool						SHTOOL-PATH.TMP(1)

NAME
shtool-path - GNU shtool command dealing with shell path variables SYNOPSIS
shtool path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path path] str [str ...] DESCRIPTION
This command deals with shell $PATH variables. It can find a program through one or more filenames given by one or more str arguments. It prints the absolute filesystem path to the program displayed on "stdout" plus an exit code of 0 if it was really found. OPTIONS
The following command line options are available. -s, --suppress Supress output. Useful to only test whether a program exists with the help of the return code. -r, --reverse Transform a forward path to a subdirectory into a reverse path. -d, --dirname Output the directory name of str. -b, --basename Output the base name of str. -m, --magic Enable advanced magic search for ""perl"" and ""cpp"". -p, --path path Search in path. Default is to search in $PATH. EXAMPLE
# shell script awk=`shtool path -p "${PATH}:." gawk nawk awk` perl=`shtool path -m perl` cpp=`shtool path -m cpp` revpath=`shtool path -r path/to/subdir` HISTORY
The GNU shtool path command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1998 for Apache. It was later taken over into GNU shtool. SEE ALSO
shtool(1), which(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-PATH.TMP(1)

Check Out this Related Man Page

SHTOOL-TABLE.TMP(1)					      GNU Portable Shell Tool					       SHTOOL-TABLE.TMP(1)

NAME
shtool-table - GNU shtool pretty-print a field-separated list SYNOPSIS
shtool table [-F|--field-sep sep] [-w|--width width] [-c|--columns cols] [-s|--strip strip] strsepstr... DESCRIPTION
This pretty-prints a list of strings as a table. OPTIONS
The following command line options are available. -F, --field-sep sep Separate columns using sep. Default is ":". -w, --width width Width of each column. Default is 15 characters. -c, --columns cols Number of columns. Default is 3. -s, --strip strip Strip off any characters past strip. Default is 79. EXAMPLE
# shell script shtool table -F , -w 5 -c 4 "1,2,3,4,5,6,7,8,9,10,11,12" HISTORY
The GNU shtool table command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1999 for GNU shtool. SEE ALSO
shtool(1), tr(1), fmt(1), sh(1), awk(1), sed(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-TABLE.TMP(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for string and display those NOT found

In my script I read a input file and search all the files in a directory and it's sub-directories for that string using: find . -type f -print | xargs grep $var1 This just displays all the lines the string was found on. Too much data. What I need is to store in a file one time those... (17 Replies)
Discussion started by: John Rihn
17 Replies

2. UNIX for Advanced & Expert Users

AWK instead of Shell script

I've a list file, which has some file names. ex: list file "list_file" will have data_file1.txt data_file2.txt data_file3.txt : : data_filen.txt Above files will have the below layout: Header1 Header2 *TM* Data record 1 Datarecord 2 Datarecord n *TM* (19 Replies)
Discussion started by: Lokesha
19 Replies

3. Shell Programming and Scripting

Shell Programming and Scripting

Hi, Iam having the files as follows: file1 aa aa aa aa ab ac ad ae file2 aa aa ab Outputfile: (20 Replies)
Discussion started by: nivas
20 Replies

4. Shell Programming and Scripting

NEW: need help with nawk using -v vars

I'm trying to pass nawk a shell variable to be used in a pattern match. I can't get this work. I'm calling nawk from a /bin/sh I want that when somebody enters Trunk Group in variable TGR so it goes into nawk variable TG. echo "Enter TRUNK GROUP:" read TGR cat... (20 Replies)
Discussion started by: wakhan
20 Replies

5. Shell Programming and Scripting

find & copy files with absolute path

hi all, can i get script find file & copy that file with path for an example sourse : /home/abc/ destination : /home/backup/ files which need to find : tmp* copy these files with its absolute path inside like :- /home/abc/x/y/z/tmp.txt to /home/backup/date/x/y/z/tmp.txt thanks in... (15 Replies)
Discussion started by: jagnikam
15 Replies

6. Shell Programming and Scripting

find | gawk --- NOT WORKING

Hi every1:) I have a problem with find and Pipe to gawk. Find -name '*.txt' -> works fine.. Gives all the txt file under home directory and sub directories But when I use it like this (see below). Find -name '*.txt' | gawk -F '\t' "script" :confused: It doesn't work.... (22 Replies)
Discussion started by: Needhelp2
22 Replies

7. Shell Programming and Scripting

cleanup $PATH with awk

Hello there, I want to remove duplicate directories of $PATH. I already have the code (found in this forum), which removes duplicate lines in a textfile. awk 'x++==0' filename By how do I use this for the $PATH-variable? (17 Replies)
Discussion started by: doc_symbiosis
17 Replies

8. Shell Programming and Scripting

Help with extract using awk

I am trying to get the filenames which is $9 when i use ls -lrt but i am getting only some of the name using below command. ls -lrt *.edf is it bcs the filename has spaces in between them? How can I get the complete file name in cases like this? (19 Replies)
Discussion started by: dsravan
19 Replies

9. Shell Programming and Scripting

Truncate path and keep only filenames

Hi everyone, I have a question for you, I'm trying to create a script that will automate creating loading screens for the iPhone. So what I need to do, is list the directories inside /var/mobile/Applications and scan inside those, for the .app directory inside each. Take that .app name... (15 Replies)
Discussion started by: kicker75
15 Replies

10. Shell Programming and Scripting

awk regex problem

hi everyone suppose my input file is ABC-12345 ABCD-12345 BCD-123456 i want to search the specific pattern which looks like - in a file so i used this command cat $file | awk ' { if ($0 ~ /-/) { print } }' so it gives me the result as ABCD-12345 BCD-12345 BCD-12345 ... (31 Replies)
Discussion started by: aishsimplesweet
31 Replies

11. Shell Programming and Scripting

ls -l /directory/path | grep -f filter.txt NOT WORKING

Hi, I have been searching all over and cannot find a script or command that simply search or match the filenames listed in a file and match it from a directory. so far, example: cat filter.txt file1.def file2.conf file3.def ls -l /directory | grep -f filter.txt (15 Replies)
Discussion started by: wolf@=NK
15 Replies

12. Shell Programming and Scripting

Replacing exact match

Hi All, My Input file contains a 1000’s of lines in which I have to replace a a string to the other. Here the problem is, I have the lines in my Input as below. Cable Yes && !Pay TV && !ADS \noUE \Label="Cable Yes && !Pay TV && !ADS" I want to replace exactly the string Cable Yes &&... (37 Replies)
Discussion started by: am24
37 Replies

13. UNIX for Advanced & Expert Users

Detecting unused variables...

Hi guys... The first active code line in AudioScope.sh is set -u . This causes a complete exit if a variable is used/found but has not been allocated at the start of the program. However, apart from writing code to do the task, is there a switch to to check which variables have been... (17 Replies)
Discussion started by: wisecracker
17 Replies

14. Shell Programming and Scripting

awk to compare each file in two directores by storing in variable

In the below bash I am trying to read each file from a specific directory into a variable REF or VAL. Then use those variables in an awk to compare each matching file from REF and VAL. The filenames in the REF are different then in the VAL, but have a common id up until the _ I know the awk portion... (15 Replies)
Discussion started by: cmccabe
15 Replies

15. Shell Programming and Scripting

How to make awk command faster for large amount of data?

I have nginx web server logs with all requests that were made and I'm filtering them by date and time. Each line has the following structure: 127.0.0.1 - xyz.com GET 123.ts HTTP/1.1 (200) 0.000 s 3182 CoreMedia/1.0.0.15F79 (iPhone; U; CPU OS 11_4 like Mac OS X; pt_br) These text files are... (21 Replies)
Discussion started by: brenoasrm
21 Replies