Thank you for the replies. I've since trialed the code you provided, and I certainly get a string that shows as an output:
"
The issue though is that the output doesn't seem to assign a variable to the respective items. For instance, when I ran my latest code, I got the following result:
However, if in the same script, I try to run
I would expect to get the resulting output of "169.12" to appear. Instead I get nothing.
I apologize in advance, as I am quite sure that I am the problem here, and that my lack of knowledge is what's getting in the way. Thank you for your patience so far -Hansol
I need to read a file (a list) and assign the value to a variable (for each line), I'm looping until the end of the file. My problem is, I want to assign 2 separate variables from the list. The process I'm using is:
awk '{print $3}' file1 > file2
awk '{print $4}' file1 > file3
cat file2... (2 Replies)
Hi,
I have a bash script that accepts some parameters as input, like:
sh script.sh first second third .....
I want to save these parameters as different variables, something like:
VAR1=first
VAR2=second
etc
I tried this, but apparently it didn't worked....... (16 Replies)
Hello,
I have a paramter $param consisting just of two literals and want to split it into two parameters, so I can combine it to a new parameter <char1><string><char2>, but the following code didn't work:
tmp_PARAM_1=cut -c1 $PARAM
tmp_PARAM_2=cut -c2 $PARAM... (2 Replies)
Hi,
I have a file like the following...
CUST=
DIR=
NULIST=
name=philps_123
How can i add values to each of these unassigned variables using a shell script?
say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Hi ,I am trying to assign string to variable ,but it doesn't work
Also could you show me different ways to use grep,(I am trying to get the first,second and first column form file,and I am counting the chars)
let name=`grep "$id" product | cut -c6-20` (25 Replies)
Hello
I have a text file with the next pattern
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
I want to assign to external variables the grades using the awk method.
After i read the file line by line in order to get the grades i use this
... (2 Replies)
How can I read a string delimited on spaces and assign the fields to incremented variables.
For example:
Given $exts= txt dat mov
I want to read in $exts and have "txt" "dat" and "mov" assigned to incremented variables like $ext1, $ext2, etc. I would like to do this in a loop so that I can... (4 Replies)
Hi guys,
I'm currently writing a script for automating a FreeBSD ZFS setup (ZFSonRooT). I got stuck at one point for raidz(1,2 a.k.a raid5,6) and am in need of assistance.
This is what I need. example:
#!/bin/sh <- must stay sh
echo -n "hdd list: "
read hdd_list
echo -n "hdd label list:... (2 Replies)
i have a program that spits out a certain number of values. i dont know the number of values. they can be 4, 10, 7, 20, no idea.
but, i want to be able to assign each of the value returned by this program to a variable.
in the latest instance, the program gave the following 6 values:
4... (8 Replies)
Hi all,
i have a .csv file with only two columns, like:
Login;Status
Luca;S
Marco;
Stefano;
Elettra;S
Laura;
...
I need to replace the blank space on Status column whit Enabled end, on the same column, S whit Disabled, like:
Login;Status
Luca;Disabled
Marco;Enabled
Stefano;Enabled... (10 Replies)
Discussion started by: kamose
10 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)