I've been having trouble with cat and variables. If I do the following:
I get the contents of the file named filex
If I do
I get cat : cannot open X-0101\ 2-10-2013.txt.
I have tried to do cat $var2 without quotes as well, but nothing works. The file name is X-0101\ 2-10-2013.txt. There is a space after \.
Does anyone know why this behavior? It is probably something simple. it might be associated with the whitespace, but I thought the quotes would stop that from being an issue
This sounds like you have set the variable correctly. Are you sure the file is in the same directory where you're issuing this command? (Though in this case No such file or directory would appear) And are you sure you have appropriate (read) permissions on this file? (Though in this case Permission denied would appear)
Below are three variables, which I want to pass into variable RESULT1
username1=userid
poihostname1=dellsys.com
port1=8080
How can I pass these variables into below code...
RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 Replies)
Hi All,
I've got a script to output YAML data, and I want to display data that's held inside variables inside one large CAT area. What's the easiest way to do this?
cat << "END"
---
classes:
- general_image
- $intro #Variable 1
- $mid #Variable 2
... (2 Replies)
Hello,
So I sorted my file as I was supposed to:
sort -n -r -k 2 -k 1 file1 | uniq > file2
and when I wrote
> cat file2
in the command line, I got what I was expecting, but in the script itself
...
sort -n -r -k 2 -k 1 averages | uniq > temp
cat file2
It wrote a whole... (21 Replies)
cat myname.txt
John Doe I
John Doe II
John Doe III
-----------------------------------------------------------------------
for i in `cat myname.txt`
do
echo This is my name: $i >> thi.is.my.name.txt
done
-----------------------------------------------------------------------
cat... (1 Reply)
Hello everybody,
I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
hi All
I have a file that has 4 lines:
1. yesterday's date (mm/dd/yyyy)
2. yesterday's day- dd
3. yesterday's month- mm
4. yesterday's year- yyyy
I want to read this file and place them in variables. how can I do this.
Please help.
thanks in advance!!
KS (3 Replies)