10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have tried with the following:
csh -c 'source ~/.cshrc; exec bash' # works perfectly
(cat ~/.cshrc; echo exec bash) | csh # not working
And, using sed, I successfully retrieved the environment variables from ~/.cshrc
sed -rn 's/setenv\s+(\S+)\s+(.*)$/export \1=\2/p' ~/.cshrc
but now... (6 Replies)
Discussion started by: royalibrahim
6 Replies
2. Shell Programming and Scripting
My manager required that i keep the hostnames and username and password in a separate file when creating my sftp script.
(Don't mention passwords and sftp...I've talk to him about this several times)
I have a list of hostnames that have to be read in a loop in my main script.
I don't know... (3 Replies)
Discussion started by: MJCreations
3 Replies
3. Shell Programming and Scripting
Hi All,
I have the following awk code where I am passing 4 variables to the program and I need to print them in the awk script.
The variables are $start_month $start_date - $end_month $end_date.
printf("\tFor More Information\n") > out_tmp1
printf("\tIf you have any questions about this... (6 Replies)
Discussion started by: nua7
6 Replies
4. Programming
Hello guys! It's orszhak and in my book I am currently studying incrementing values in c++ and it states thant I could do this to increment the value of nVariable nVariable = nVariable + 2; it states that I could also do this and assign the same value nVariable += 2; but can't I also do this and... (1 Reply)
Discussion started by: orszhak
1 Replies
5. UNIX for Dummies Questions & Answers
Hi
I am trying to find were to look for definitions of these variables; $0, $1, $2, $#, $$ , $*. I am not having much luck with my searching. Can anyone point me in the right direction?
Thanks, Doug (3 Replies)
Discussion started by: Reddoug
3 Replies
6. Linux
Hi everybody, im trying to store a path "address" of a file in a variable, then IF the Address that the user entered INSIDE the variable is exist, do something, else echo invalid file address.
here's my code, but it's not working i dunno why:
$variable
cat > variable
#variable will contain... (4 Replies)
Discussion started by: iam_ako
4 Replies
7. Shell Programming and Scripting
What does this mean?
#!/bin/bash
BACKUPFILE=backup-$(date +%m-%d-%Y)
archive=${1:-$BACKUPFILE} (4 Replies)
Discussion started by: hin-linux
4 Replies
8. Shell Programming and Scripting
Hi,
I am trying to do some mass replacements in lots of scripts, and using sed.
However sed doesn't seem to like to be able to dereference variables within the substitute clause. For example:
tab=newtable
cat f1 | sed 's/oldtable/$tab/g' doesn't work.
it would replace oldtable with the... (2 Replies)
Discussion started by: fwellers
2 Replies
9. UNIX for Dummies Questions & Answers
I am looking for 8 variables in the following profile. I am looking to see if anyone could explain this for me better than the book I am using has been able to. There are 5 system, 2 aliases, and one editor. The profile is as follows:
# @(#)local.profile 1.8 99/03/26 SMI
stty istrip... (0 Replies)
Discussion started by: wswaner
0 Replies
10. Shell Programming and Scripting
I'm using the following command to test for certain characters in a script
echo "${1}" | grep '\$'
if (( ${?} == 0 ))
then
testing this script on the command line I have
ksh -x script1.sh "xxxx$xxxx"
this works fine but when I want to use
ksh -x script1.sh "xxxx $xxx"
the... (1 Reply)
Discussion started by: frank
1 Replies