10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using echo in bash. Have created a function prargv which takes a number of arguments.
Example:
prargv "-e" "--examples"
Inside prargv, I want to print all the arguments using echo
echo "$@"
This returns
--examples
rather than
-e --examples"
This problem can be fixed... (3 Replies)
Discussion started by: kristinu
3 Replies
2. Shell Programming and Scripting
Hi ,
I am looking for a function which will do the following.
1. I have a variable which will hold few special chracter like
SPECIAL_CHARS="& ;"2. I have an escape character.
ESCAPE_CHAR="\"3. Now when I passed some string in the function it will return the same string but now it will... (8 Replies)
Discussion started by: Anupam_Halder
8 Replies
3. Shell Programming and Scripting
Hello!
I am able to do this in bash, using:
echo -ne HELLO > file.txt
and then, 'HELLO' is written into file.txt without the newline character to be added in the end of the file.
How is this possible to be done using sh instead of bash?
If I try something similar is SH, then inside... (3 Replies)
Discussion started by: hakermania
3 Replies
4. Shell Programming and Scripting
Please explain why this works. Am unable to find another definition for the '%', which would explain this behaviour:
spaceLeft=`df -h /myPartition | tail -1`
# output looks like: /dev/sda5 10G 1.2G 12G 29% /
set -- $space
#this deletes the trailing '%' sign, which is... (6 Replies)
Discussion started by: frododot
6 Replies
5. Programming
Hi all,
Sorry for the title because I didn't find a proper name for it. My question is about POSIX functions, such as timer_create(), mq_open() and pthread_create().
void test_queue()
{
struct mq_attr attr;
attr.mq_maxmsg = 10;
attr.mq_msgsize = 64;
mq_unlink("/my_test_queue");... (6 Replies)
Discussion started by: bus147
6 Replies
6. Shell Programming and Scripting
My script-
result=""
times()
{
echo "inside the times function"
result=8
echo "Inside function $result"
return $result
}
result=$(times)
echo "the value is "$?
echo "the value of result $result"
when I run I get this, why the value still remain 0.
$ ./func
the value is 0
the value... (5 Replies)
Discussion started by: boy18nj
5 Replies
7. Shell Programming and Scripting
Hi,
I have a pipe delimited file and I am running into an issue where a field is having some weird character and I am not able to clean it up. It is 2nd field and the weird character is M- . See below.
cat -v test.dat
02169| M- PATRICKM- MCALEER |Y
01318| M- LARRYM- PETERSON |Y
30319|... (5 Replies)
Discussion started by: msalam65
5 Replies
8. UNIX for Dummies Questions & Answers
hi,
I have a for loop where in I write some file name to another file.
I want to write all the filenames to another without any newlines. how can i avoid getting new lines with echo?
Thanks,
Srilaxmi (2 Replies)
Discussion started by: srilaxmi
2 Replies
9. Shell Programming and Scripting
Hi,
First of all i am using solaris 10. I want to write a script that ask user to enter password and read the character input from keyboard. The ask to re-enter the password and then if they are match it will accept.
But my problem is I want to echo a '*' character instead of the character I... (4 Replies)
Discussion started by: alanpachuau
4 Replies
10. Shell Programming and Scripting
#!/bin/bash
INPUT=$1
if
then
INPUT=0$1
TRACKNUMBER=$INPUT
fi
TRACKNUMBER=$INPUT
echo "Track Number:" $TRACKNUMBER
if
then
echo "File Does Not Exist!: split-track"${TRACKNUMBER}".wav"
exit 0
fi
CUEFILE="$2" (6 Replies)
Discussion started by: TinCanFury
6 Replies