10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all, i'm new in shell script. i'm trying to do this:
mypid="ps | grep whileloop.sh | sed -n 1p | tr -s ' ' | cut -f2 -d' '"
i'm trying to assign the pid number to variable mypid, but it doesn't work...how can i do? thanks (5 Replies)
Discussion started by: Marina2013
5 Replies
2. Shell Programming and Scripting
I see a millioin ways to do this with echo, but what I wan to do is assign a variable the "nth" character of an incoming parameter to a ksh script.
$1 will be "pia"
I need to assign the first character to stmttype. (10 Replies)
Discussion started by: klarue
10 Replies
3. UNIX for Dummies Questions & Answers
I have several lines in a file that I want to replace a space with a tab.
For example:
111047 Julie Jones email@email.com
111047 Julie Jones email@email.com
I want to replace the space after the word "jones" with a tab.
How do I achieve that in Vi?
Please assist.
Thanks! (5 Replies)
Discussion started by: onlinelearner02
5 Replies
4. Shell Programming and Scripting
Hello Experts,
In my script i am using the below syntax
/usr/bin/head -1 /opt/chumma.txt | /usr/bin/cut -d " " -f3
output of this one is --> Monday
I want to store this String in a variable (i.e) j or k...
Give me some idea experts.
Thanks in advance. (7 Replies)
Discussion started by: natraj005
7 Replies
5. Shell Programming and Scripting
Hi ,I am trying to assign string to variable ,but it doesn't work
Also could you show me different ways to use grep,(I am trying to get the first,second and first column form file,and I am counting the chars)
let name=`grep "$id" product | cut -c6-20` (25 Replies)
Discussion started by: lio123
25 Replies
6. Shell Programming and Scripting
I have a string as "yes why not"
I want to create one array variable with contents as one word per place in array..
for above string,the array variable should contain...
x="yes,why,not"
x = yes
x = why
x = not
Please help me,I am stuck up in the problem since 2 days... (3 Replies)
Discussion started by: uday26
3 Replies
7. Shell Programming and Scripting
guys,
I need to know how to assing pattern matched string as an input command variable. Here it goes'
My script is something like this.
./routing.sh <Server> <enable|disable>
## This Script takes an input <Server> variable from this line of the script ##
echo $1 | egrep... (1 Reply)
Discussion started by: raghunsi
1 Replies
8. Shell Programming and Scripting
How...
can I read input by a user character by cahracter. And assign each character from the string to a variable?
Any help would be greatly appreciated!
Thank you! (1 Reply)
Discussion started by: Tek-E
1 Replies
9. Shell Programming and Scripting
I come across the problems when assigning the array in the script below . How to use the array with the 'string index' correctly ? When I assign a new string index , the array elements that are previously assigned are all changed .:eek::eek::eek:
$ array=211
$ echo ${array}
211
$... (4 Replies)
Discussion started by: youareapkman
4 Replies
10. Shell Programming and Scripting
Hi All,
I am new to bash scripting. I need your help to removing spaces from a string and assign them to different variables.
Iwant to call script with one command line argument which is file name which containes different attributes their type and different values eg
... (1 Reply)
Discussion started by: flextronics
1 Replies