Creating the array.
This is the basic idea, but not working at the moment.
It just seems to be returning "No such file or directory"
for each array member
The code that you have is looking for lines containing @ in the files named by lines in the file named by the expansion of the shell variable temporary_file. Presumably you're getting error messages because the lines in your file are not names of files to be searched.
If what you want to do is print lines in the file named by $temporary_file that contain an @, that would much more simply be done by:
If you want a way to determine if the expansion of a shell variable ($x in this example) contains an @ using only features that are available in all standards conforming shells, you could try something like:
brothers and sisters
iam a new member of your respectful forum
hope to accept me
i really would like to an expert in unix and linux
so please tell me how could ?
and what i should have ?
i want to make my project in these subject
but i dont know what to do
and which... (12 Replies)
Hi,
I am writing a bash shell script. I would like to execute a statement only if an array contains a specific value. For example:
array=(1 3 5 7)
I would like to execute the statement only if the value 3 is present in ${array}.
Thanks for any help,
Mike (1 Reply)
Hi,
I have a file that contains thousands of records. Each record starts with "New Record". I need to search this file based on a given value of "timestamp" and write all the records that match this timestamp into a new file.
I was able to locate the existence of a given value of timestamp using... (10 Replies)
Hi,
Here is a tough requirement , to be served by bash script.
I want to perform 3,00,000 * 10,000 searches.
i.e. I have 10,000 doc files and 3,00,000 html files in the file-system. I want to check, which of the doc files are referred in any html files. (ex- <a href="abc.doc">abc</a>)... (3 Replies)
HI Bruce from Central PA
I have never used Unix but am sick of Microsoft so want to learn it.
I use to own a computer store front and training center and stated our with Atari, Commodore and the 1st PC and MS/DOS then Windows
BUT sick of Microsoft controlling the computer industry.
... (2 Replies)
Hi ,I have seen this comverters before ,but I was searching today and I can not find them .Is anybody used them before .Any recomendations
Thanks (5 Replies)
without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Hello,
I'm trying to write a script in Bash to assist in pentesting. Essentially I'm looking to use a script to search for some terms in a log file and then send that key information into another file.
The log files consist of HTTP and SSL information that someone creates while browsing and... (2 Replies)
Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help.
pesudo code
if == ENDSINFIVEINTS ]]; then
do... (4 Replies)
Hi guys! My name is Leonida and I am new here to this forum. Nice meeting you all. (1 Reply)
Discussion started by: leeoona
1 Replies
LEARN ABOUT LINUX
rbash
RBASH(1) General Commands Manual RBASH(1)NAME
rbash - restricted bash, see bash(1)RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is
used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the follow-
ing are disallowed or not performed:
o changing directories with cd
o setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV
o specifying command names containing /
o specifying a file name containing a / as an argument to the . builtin command
o specifying a filename containing a slash as an argument to the -p option to the hash builtin command
o importing function definitions from the shell environment at startup
o parsing the value of SHELLOPTS from the shell environment at startup
o redirecting output using the >, >|, <>, >&, &>, and >> redirection operators
o using the exec builtin command to replace the shell with another command
o adding or deleting builtin commands with the -f and -d options to the enable builtin command
o using the enable builtin command to enable disabled shell builtins
o specifying the -p option to the command builtin command
o turning off restricted mode with set +r or set +o restricted.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed, rbash turns off any restrictions in the shell spawned to execute the script.
SEE ALSO bash(1)GNU Bash-4.0 2004 Apr 20 RBASH(1)