I created some new accounts on a dev seat: Code: useradd -m newUser1.Users get created fine and can log in but are missing all the bash files (.bashrc, .bash_history, etc). When these users try to use the up and down arrows to view shell history they get junk characters. I checked and there is no history file in their homes. Where is the environmental variable set and how can I get this working?
I'm trying to make an environmental variable RPMS that will resolve to a website. I know I have to make the changes in .bash_profile, but all the things I try don't seem to want to work.
I've tried: PATH=$RPMS:ftp://rha-server/pub/os/rhel5/Server/ or simply just making the variable itself $RPMS=ftp://rha-server/pub/os/rhel5/Server/
The second one made a variable just fine, but when I attempted to run this command:
I am Just trying to set the Environmental variable using a script file and my code is as follows:
#!/bin/bash echo $PATH PATH=${PATH}:/opt/bin export PATH echo Environmental Variable path is Set echo $PATH
When I am running the above script, from the last line "echo $PATH" I am getting that /opt/bin has been appended to the PATH but again when I am typing echo $PATH in the terminal I am not getting the newly appended path.
i am trying to declare an environmental variable in the /etc/profile' (as per the tutorial i'm following) but when i declare it and do an echo i get nothing.Here's what i've done so far..nside /etc/profile:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ -d /etc/profile.d ]; then
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
I need to replace JAVA_OPTS= with JAVA_OPTS=<some_value>.I need to give "" value at the end of the replacement. I have tried with the following but it is not working: sed -e "s|JAVA_OPTS= |JAVA_OPTS=<some_value>"
how shall I print each variable separately using a generalized form. I tried writing the following within a for loop...Code:echo $(echo a$(echo $i)$(echo $j))which did yield no result. So what shall I write??
Event 1............................................................ full_name: JENNY_JENNINGS genre: f age: 32
[code]....
But as you can see in the input, in the 2nd "Event", the line containing "age" is not present, but in the output my code is printing the 1rst age value twice. The correct output should be blank in the age field for 2nd line in the output like this:
i'm trying to execute a shell script, i'm trying to use the values in an array for use in a sed command:
sed -n '/Sales ID: ${array[$i]}/,/Totals:/p'
that command creates empty files. so my guess is that its not recognizing the array as an array but as text? how would i be able to utilize the array in the command? i got it, didnt think that if i doubled up the single quotes that it would work, but this worked:
It compiles fine, but gets stuck in the loop. z never increments. I was using a for loop originally but had the same problem so I decided to try a while loop.
Just a simple BASH for loop to read the file path from a text file (clean.txt) echo the variable for debug purposes, and scp it to a server I have using port 50 for SSH.
I've already formatted the entries in clean.txt to handle spaces correctly, using sed replacement.
Example from the clean.txt file:
Code: /MP3/NAS000000001/Barenaked Ladies/Barenaked Ladies - Barenaked For The Holidays/20 Auld Lang Syne.mp3 /MP3/NAS000000001/Barenaked Ladies/Barenaked Ladies - Barenaked For The Holidays/14 Deck the Stills.mp3
I am trying to create a script to be used on RHEL server. If I replace the $t with a number, the script works. If I try add a variable or the $1, the script doesn?t work (returns all processes even if less than the $t value). I thought that it may be treating it as a literal, but I wasn?t sure of the conversion.