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-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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)