Sponsored Content
Top Forums Shell Programming and Scripting I can't store value in the variable Post 302890550 by Muhammad Rehan on Thursday 27th of February 2014 11:29:15 AM
Old 02-27-2014
My whole command is not working with "$( )' method of yours
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Store command O/P to a variable...

Hi all.. I got a problem.. Its easy to redirect o/p to a file.. But Is it possible to redirect the O/P to a variable? For example: I've a command in my script: string1=cut -d ':' -f2 file.txt When I do: echo $string1 The value is empty... Pls suggest me how to store the value... (7 Replies)
Discussion started by: smartbuddy
7 Replies

2. Shell Programming and Scripting

store timestamp in a variable

I am new to Unix shell Script _________________________ db2 connect to r2pdev user bmwdevup using summer08 >>$monlog # get the current timestamp from SYSIBM.SYSDUMMY1 currenttimestamp="" echo "Run SQL select current timestamp from SYSIBM.SYSDUMMY1 with ur" >>$monlog db2 "select current... (8 Replies)
Discussion started by: regnumber
8 Replies

3. Shell Programming and Scripting

Help in scripting, store value in variable

Hi all, I have a script in which i need to run a command like "/opt/dell/srvadmin/sbin/omreport about" and output will be something like Version : 6.3.0 Copyright : Copyright (C) xxx Inc. 1995-2010 All rights reserved. Company : xxx Inc. In this i need to save the version... (13 Replies)
Discussion started by: Renjesh
13 Replies

4. Shell Programming and Scripting

Store o/p of awk in a variable

Hi , Here is my script echo 'Enter MSISDN for the Calling Number' read ms acc=`sqlplus -s testing/testing123@BP_$ARBORENV<<EOF set heading off; set feedback off; select external_id from external_id_equip_map where subscr_no = (select subscr_no from external_id_equip_map where account_no =... (1 Reply)
Discussion started by: Pratik4891
1 Replies

5. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

6. Shell Programming and Scripting

cut and store last value of a variable into other

Hi All, I am a newbie to unix.starting my career in unix.need 1 help from you all..pls help.. i am passing a file name "abc_delta" as argument to my script1.sh. if file name contains "_delta" at last then echo pass else fail.how to fix it. Note:file name will always contain "_delta" at... (10 Replies)
Discussion started by: pradeepcarya
10 Replies

7. UNIX Desktop Questions & Answers

How to store the value of grep in a variable

Hi , I was trying to store the value of a grep command to store in a variable so i can use it somewhere else in my script but i am getting error, i am using bash shell in linux: var= `grep -n "$DATE" testfile.log | head -n 1 | sed -n 's/^\(*\).*/\1/p` echo "$var"I get the error: unexpected... (5 Replies)
Discussion started by: learninguser235
5 Replies

8. Shell Programming and Scripting

how to store output to a variable

I need some help: 1) I have a out put from a shell script, the out put looks like this: Attempting privilege escalation using sudo ... List backups for CLTST: Start date Status Ret. Class Label -------------------- ------------ ------------ ... (2 Replies)
Discussion started by: samk
2 Replies

9. Shell Programming and Scripting

How do I store stdout in a variable?

These seems ridiculously simple but I can't get it to work. Using korn shell and I want to pass in a flag to tell my echo statements to either write to the screen for debugging or a file if not. So I have something like: if ; then logout=&1 else logout='logfile.out' fi Then... (2 Replies)
Discussion started by: DJR
2 Replies

10. Shell Programming and Scripting

Store ^M character in variable

Hi, I want to store ^M character in a variable to be later written to a file. Can you please help. TempOut="$_var1 `print '\x0D'` $_var1" ..... .... echo $TempOut >> logfile TempOut="$_var1 `echo -e '\x0D'` $_var1" ..... .... echo $TempOut >> logfile But both ways I am... (2 Replies)
Discussion started by: tostay2003
2 Replies
mrd(1)							      General Commands Manual							    mrd(1)

NAME
mrd - mtools utility to remove a DOS directory SYNOPSIS
mrd msdosdirectory [msdosdirectories...] DESCRIPTION
The mrd command removes a directory from a DOS file system. If the directory is not empty, an error occurs. Unlike DOS conventions, this command allows multiple arguments. DOS subdirectory names that contain the '/' or '' separator are supported. If you use the '' separator or wildcards, you must enclose file names in quotes to protect them from the shell. The mcd command can be used to establish the device and the current working directory (relative to DOS), otherwise the default is A:. EXIT STATUS
The following exit values are returned: Success. Failure. ENVIRONMENT VARIABLES
The following environment variables affect the execution of mrd: If set, this variable names the file that contains the name of the current mtools working directory as established by the mcd command. If this variable is not set, the file $HOME/.mcwd is used. FILES
Contains the name of the current mtools working directory as established by the mcd command. If this file does not exist, the default mtools working directory is A:. Executable file SEE ALSO
Commands: mcd(1), mmd(1), mtools(1) mrd(1)
All times are GMT -4. The time now is 06:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy