what does the below mentioned command do?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting what does the below mentioned command do?
# 1  
Old 07-19-2010
what does the below mentioned command do?

Hi,
Can someone please help as to what does the below mentioned command do?

Code:
root=$(echo $0|sed 's#extras/package/win32/configure-msys.sh##')./

here,when I simply echo $0 i get
Code:
 ..\..\..\..\..\..\msys\1.0\home\admin\vlc\extras\package\win32\configure-msys.sh


Last edited by Scott; 07-19-2010 at 07:31 AM.. Reason: Code tags
# 2  
Old 07-19-2010
Hi.

Whatever it's supposed to do, it doesn't work. The slashes are the wrong ones!

If they were the right ones, the output would be:
Code:
$ cat Test1
# imagine X is $0!
X=" ..\..\..\..\..\..\msys\1.0\home\admin\vlc\extras\package\win32\configure-msys.sh"

root=$(echo $X|sed 's#extras/package/win32/configure-msys.sh##')./
echo What it is doing: $root

X=$(echo $X | tr '\' '/')
root=$(echo $X|sed 's#extras/package/win32/configure-msys.sh##')./
echo What I guess it should be doing: $root

$ ./Test1
What it is doing: ..\..\..\..\..\..\msys\1.0\home\admin\vlc\extras\package\win32\configure-msys.sh./
What I guess it should be doing: ../../../../../../msys/1.0/home/admin/vlc/./

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep for all ip addresses mentioned in all files in a Directory

I wish to traverse all files and folders under a given directory say "/tmp/configuration" and for all ip address mentioned therein. I tried find ./ -type f | xargs grep "*.*.*.*" but it does not populated the correct results. Can you please suggest. (1 Reply)
Discussion started by: mohtashims
1 Replies

2. Shell Programming and Scripting

Grep for string, but within mentioned bounds

Hi, I've been trying to filter a file which has several repetitions of lines which looks as follows: ('hello My name is jamie blabla xyz>>) Each line has different values in them. I want grep or awk or sed to treat everything within the (' and >>) as one line and then filter for a... (2 Replies)
Discussion started by: jamie_123
2 Replies

3. UNIX for Dummies Questions & Answers

How to modify the file mentioned in the Message details ?

i have a below file state : CONNECTED ; state : CONNECTED ; state : CONNECTED ; Rno : 5554f1d2-6f1b Rno : 10587563-4181 Rno : be6312f7-b4df the entire content in the fileis obtained by making two seperate Curl calls( one curl call gives me state when i grep the... (3 Replies)
Discussion started by: Vaibhav H
3 Replies

4. Shell Programming and Scripting

Need the output in the mentioned Table format

Hi Friends, I have the script output like below: Script Output: ----------------------------------------------------------------------- Details of the Client: ----------------------- name: server1; save set: All; ... (3 Replies)
Discussion started by: akmani
3 Replies

5. Shell Programming and Scripting

How to write bash shell script for mentioned requirement?

Hi All, I am unable to write the script for the below requirement. Requirement: Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" . This dir_ancillary contain undefined tables in the column... (2 Replies)
Discussion started by: Vineeta Nigam
2 Replies

6. Shell Programming and Scripting

Count and separate entries with N/A mentioned in front

Hi all, I have afile with following data I want to separate, count the entries with N/A in front of it so I will have all the entries with N/A in front seprate file . so output shuld be (7 Replies)
Discussion started by: manigrover
7 Replies

7. Shell Programming and Scripting

Request to check:remove entries with N/A mentioned

Hi I have a file with following entries 122 N/A 123 5654656 123423 43534543 4544 45435 435454 N/A i Have to remove entries with N/A so that only 123 5654656 123423 43534543 4544 45435 remain in output file can anybody guide for a code/unix/perl (2 Replies)
Discussion started by: manigrover
2 Replies

8. Shell Programming and Scripting

How to write a script for the below mentioned issue

hello Forum members, I have a encrypted file which consist Unames and Pwd in the encrypted form and i have to write a script the PWD from the file and redirect into a log file.please find below the file and please help write a script. _config.id_dbs is the file which will open with a... (0 Replies)
Discussion started by: rajkumar_g
0 Replies

9. Shell Programming and Scripting

Not able to make the file size 0 with the mentioned script

#!/bin/sh ########################################################################################################## #This script is being used for AOK application for cleaning up the .out files and zip it under logs directory. # IBM # Created #For pdocap201/pdoca202 .out files for AOK #1.... (3 Replies)
Discussion started by: mridul10_crj
3 Replies
Login or Register to Ask a Question