10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a for loop that constructs a variable "filelistonly" having entries separated by "\n" new line.
The second, third & fourth while loops are my attempt to iterate the variable "filelistonly" upon new line "\n", however non of them work.
Below is my script:
//First Loop
for i in... (2 Replies)
Discussion started by: mohtashims
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am trying to customize the command prompt of the C shell as follows:
set prompt=" "
The above one works fine but when I try to add a '$' (dollar) symbol into the string as
set prompt=" " I am getting the error as: Illegal variable name
However, this one set prompt = "-- %T %n %~ --... (2 Replies)
Discussion started by: royalibrahim
2 Replies
3. Shell Programming and Scripting
This works when I try to execute normally :
echo | format | nawk '/pci@1f,4000/{print x}; {x=$0 }'
But fails when define a variable and put it in a file:
cat test
c=pci@1f,4000
echo | format | nawk "/$c/{print x}; {x=$0 }"
./test
nawk: syntax error at source line 1
context is
... (6 Replies)
Discussion started by: aksijain
6 Replies
4. Shell Programming and Scripting
Hi All,
I want to check existence of variable, whose name gets decided dynamically.
E.g. value of this variable,is derived as $option_"exclude" , where value of option varies depending upon user input.
I am trying to do it in a following way :
set exclude_var = `echo $option"_exclude"`... (3 Replies)
Discussion started by: Rashmee
3 Replies
5. Shell Programming and Scripting
my working shell is csh and even though if I try to run my script in plain sh, it behaves the same way. Here's a simple script:
#!/bin/sh
desc='"test my changes"'
cmd="echo \"$desc\""
$cmd
I want $desc to be passed as an argument to another command, but csh apparently doesn't like spaces in... (5 Replies)
Discussion started by: iskatel
5 Replies
6. Shell Programming and Scripting
I have a simple script that sets a value and reads the value in csh:
set -x
set a = 10
echo $a
The output of the script does not show the value of a
+ set a = 10
+ echo
any help would be great. (4 Replies)
Discussion started by: pt14
4 Replies
7. Shell Programming and Scripting
My shell is csh and it is required.
I have a file like sample.txt
------------------------
a b c
d
e
f
g h i
------------------------
I want set the file to a variable and print it out in the same format.
I have tried something like this, but not succed.
% cat ~/tmp/sample.txt
a b c
d... (8 Replies)
Discussion started by: anykao
8 Replies
8. UNIX for Dummies Questions & Answers
Guys,
following is my issue:
------------------------
#!/bin/csh
# specify a counter
@ k = 1
# loop
while ($k < 3)
# read all text file with a specific number less than 3 in the last column of a record
foreach file ( *.txt)
# capture the line by passing the column... (1 Reply)
Discussion started by: znbhatti
1 Replies
9. Shell Programming and Scripting
May God never give you the bane of working on Solaris.
Now, I am trying to run this simple shell script:
#!/bin/sh
input="a
b
c"
data="123"
while read eachline
do
data="$data$eachline"
done << EOF
$(echo "$input")
EOF... (2 Replies)
Discussion started by: pavanlimo
2 Replies
10. Red Hat
Hi there,
How can I change bash to csh when starting a terminal, and set some aliases for csh? I can't find such files like .cshrc in my home directory.
Thanks a lot (1 Reply)
Discussion started by: dustinwang2003
1 Replies