If I need to use (or reuse) the search result later but not immediately following "find", I would like to save it into a variable. However, the search result contains null characters as separators, and bash removes null characters either upon variable assignment or upon variable expansion. To preserve null characters, the percent-encoding is useful.
Percent encoding is widely used for URL encoding. The following method applies percent-encoding to only the null character and the percent symbol itself.
The following example saves the search result of "find" into a variable with percent-encoding.
By the way, does anyone know at which time bash removes null characters, at the time of variable assignment or at the time of variable expansion? Which time? Does bash never save null characters into a variable? Or, does bash save null characters into the variable, and does bash remove null characters when the variable is expanded?
Furthermore, without any encoding (such as percent encoding), is there any option to prevent bash from removing null characters?
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
I want to use the find command to search a ton of files, but I want to break it up into multiple machines. I want to search for files with "filename." in the title.
The location I want to search is:
/u/*/*/*/stuff
On the first computer I want to search:
/u//*/*/stuff
Right now I am doing... (1 Reply)
I guess by "pattern," I mean something different from how that word is defined in the Linux world. If you take $ to mean a letter (a-z) and # to mean a number (0-9), then the pattern I'm trying to match is as follows:
$$$##-####-###-###.jpg
I'd like to write a script that reads in a list of files... (4 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Hi All,
I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd.
What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Hi All,
I'm completely new to bash scripting and still learning my way through albeit vey slowly.
I need to know where to insert my server names', my ip address numbers through out the script alas to no avail.
I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"
They all returned the match:
./folder/file.pdf
:b:
This find returned no matches:
$ find . -path "*_nobackup*" -prune... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT SUSE
command-not-found
COMMAND-NOT-FOUND(1) http://en.opensuse.org/Sco COMMAND-NOT-FOUND(1)NAME
command-not-found - A command-not-found handler
SYNOPSIS
command-not-found {binary_name} {repository}
ARGUMENTS
The following arguments are required:
binary_name
The name of binary you are looking for.
repository
The name of repository for search. For most cases, use zypp
DESCRIPTION
command-not-found handler is designed to tell users which package contains a missing command.
The handler is integrated to bash(1) and zsh(1) shells and is not necessary to call it directly. Just type a name of the command in your
favourite shell and you'll get a result.
If you consider c-n-f handler useless, just add unset command_not_found_handle to your profile or remove the command-not-found package.
Handler doesn't call the command-not-found binary directly, it only prints info about it. If you want to invoke it automatically, just add
export COMMAND_NOT_FOUND_AUTO=1 to your bash profile.
EXAMPLE : NORMAL USAGE
For example you want to try blender, because you have heard that is an amazing program. So just type blender in shell:
$ blender
You get the following output:
The program 'blender' can be found in the following package:
* blender [ path: /usr/bin/blender, repository: zypp (openSUSE 11.1-0) ]
Try installing with:
sudo zypper install blender
bash: blender: command not found
SEE ALSO scout(1)AUTHOR
Pavol Rusnak <stick@gk2.sk>
Developer
http://gitorious.org/opensus 08/07/2009 COMMAND-NOT-FOUND(1)