Sponsored Content
Top Forums Shell Programming and Scripting Assign bash command to variable Post 302311424 by Moxy on Tuesday 28th of April 2009 03:31:55 PM
Old 04-28-2009
Thanks otheus.. thats a much nicer way of doing it. Btw I meant to type bash not ash, I have never used the ash shell.. Think i might try it out now just for fun.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

assign awk command result to a variable

#!/bin/sh # ## MYSTRING = `awk '/myApp.app/' /Users/$USER/Library/Preferences/loginwindow.plist` if then echo String not found defaults write /Users/$USER/Library/Preferences/loginwindow AutoLaunchedApplicationDictionary -dict-add -string Hide -bool YES -string Path -string... (9 Replies)
Discussion started by: dedmakar
9 Replies

2. UNIX for Dummies Questions & Answers

Cut Command value assign to variable

Hi, I am new to UNIX Scripting. I have been trying to use the CUT command to retrieve part of the header from a file and assign it to a variable. I have tried searching a lot, but I am still unsuccessful. Sample Header: HJAN BALANCE 20090616 I need to retrieve the date here, which always... (10 Replies)
Discussion started by: ragz_82
10 Replies

3. Shell Programming and Scripting

assign awk output to bash variable

greetings all, I am have a heck of a time trying to accomplish a very simple thing. I have an array of "shortname<spaces>id" created from a dscl output. I want to assign shortname=word1 and id=word2. I have tried shortname=$(${textArray} | awk '{print $1}') - and get 'awk : cannot open... (3 Replies)
Discussion started by: macnetdaemon
3 Replies

4. Shell Programming and Scripting

bash assign mysql query single field to variable

I'm running a bash script query and assigning the output to a variable like this: exists=`mysql -u $USER_NAME --password=$PASSWORD -D "somedb" \ -e "SELECT * FROM somedb.sometable WHERE field1 ='$a' \ AND field2 ='$b' LIMIT 0 , 30";` which returns something like: echo... (2 Replies)
Discussion started by: unclecameron
2 Replies

5. Shell Programming and Scripting

Bash assign string to variable

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

In bash script, how to assign output of a command to a variable while keeping tabs?

Hi, wondering if it's been asked before but didn't find matches from google. Basically I have this line: myvar=$(echo -e "a\tb") Now somehow the '\t' from the echo output gets replaced with white space and then stored in $myvar. It creates a problem for me later to use tab as delimiter to do... (2 Replies)
Discussion started by: birddie
2 Replies

7. UNIX for Beginners Questions & Answers

Need to pass variable in a command and assign value to a variable

Hello All, Hope you're doing well ! I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted. header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies

8. UNIX for Beginners Questions & Answers

How do I assign the output of a command to a variable within a loop in bash?

In the else of the main if condition . else set lnk = $(readlink -f <path> | cut -d '/' -f7) echo "$lnk" if ] When I run the above on command line , the execution seems to be fine and I get the desired output. But when I try to assign it to a variable within a loop... (12 Replies)
Discussion started by: sankasu
12 Replies

9. UNIX for Beginners Questions & Answers

Assign a command to a variable - Help

Hi, I have the script below. When i assign SSH_COMMAND to "ssh -o ConnectTimeout=2 ${SERVER} ${AS_SUDO} ${COMMANDS}" and then execute it as ${SSH_COMMAND} I get the following error: ssh: Could not resolve hostname sudo: Name or service not known ssh: Could not resolve hostname sudo: Name or... (3 Replies)
Discussion started by: mohca2020
3 Replies

10. UNIX for Beginners Questions & Answers

Using read to assign value to bash variable not working

Hi, I am attempting to assign the output of the following command, to two bash variables, var1 and var2 using "read," but it doesn't seem to be working. # openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}' vcpus 92 # echo $? 0 # openstack hypervisor... (4 Replies)
Discussion started by: sand1234
4 Replies
filezilla(1)							 FileZilla Manual						      filezilla(1)

NAME
FileZilla - FTP client SYNOPSIS
filezilla filezilla [-l <logontype>] <FTP URL> filezilla -h|-s|-v filezilla -c <site> DESCRIPTION
FileZilla is a powerful client for plain FTP, FTP over SSL/TLS (FTPS) and the SSH File Transfer Protocol (SFTP). OPTIONS
-c <site>, --site <site> Connect to the given site from the Site Manager. Site has to be given as complete path, with a slash as separation character. Any slash or backslash that is part of a segment has to be escaped with a backslash. Path has to be prefixed with 0 for user defined entries or 1 for default entries. Site path may not contain double quotation marks. Example: filezilla -c 0/foo/bar/sl/ash connects to the user site sl/ash in the site directory foo/bar May not be used together with -s nor with URL parameter. -h, --help Displays a help dialog listing these commandline options. -l <logontype>, --logontype <logontype> Set a special logontype, can only be used in combination with a FTP URL as argument. Logontype has to be either ask or interactive. If -l isn't given, the normal logontype is used. -s, --sitemanager Start with Site Manager opened. May not be used together with -c nor with URL parameter. -v, --version Display version number of FileZilla. ENVIRONMENT
The FZ_DATADIR environment variable can be used to specify the directory containing FileZilla's data files. SUPPORT
Please visit http://filezilla-project.org/ for further information. Report bugs only if you are using the latest version available from the FileZilla website. COPYRIGHT
Copyright (C) 2004-2010 Tim Kosse FileZilla is distributed under the terms of the GNU General Public License version 2 or later. SEE ALSO
fzdefaults.xml(5) April 2008 filezilla(1)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy