Sponsored Content
Top Forums Shell Programming and Scripting If no input then set directory to current Post 302956008 by wisecracker on Thursday 24th of September 2015 03:19:23 PM
Old 09-24-2015
Manually longhand using OSX 10.7.5, default bash terminal...
Always initialise the current directory before letting the timeout continue...
Code:
Last login: Thu Sep 24 20:02:19 on ttys000
AMIGA:barrywalker~> mydir=$(pwd)
AMIGA:barrywalker~> echo $mydir
/Users/barrywalker
AMIGA:barrywalker~> ls "$mydir"
03080.sh		03240.sh.txt		Downloads
03083.sh		03241.sh.txt		Library
03090.sh		2015			Movies
03100.sh		AAWG			Music
03120.sh		AudioScope.sh		Pictures
03140.sh		AudioScope.sh.txt	Public
03180.sh		AudioScope.sh~		Scope
03197.sh		AudioScope.txt		URL
03220.sh		BW_HELP			hexstring
03220.txt		Desktop			listing.txt
03240.sh		Documents		sox-14.4.0
AMIGA:barrywalker~> read -t5 mydir
/tmp/
AMIGA:barrywalker~> echo $mydir
/tmp/
AMIGA:barrywalker~> ls "$mydir"
launch-Az884J		launch-qrFcE6		launchd-119.lqY2J3
launch-PSV50N		launch-zRFZQJ		launchd-253.YZiA7D
AMIGA:barrywalker~> mydir=$(pwd)
AMIGA:barrywalker~> read -t5 mydir
AMIGA:barrywalker~> echo $mydir
/Users/barrywalker
AMIGA:barrywalker~> ls "$mydir"
03080.sh		03240.sh.txt		Downloads
03083.sh		03241.sh.txt		Library
03090.sh		2015			Movies
03100.sh		AAWG			Music
03120.sh		AudioScope.sh		Pictures
03140.sh		AudioScope.sh.txt	Public
03180.sh		AudioScope.sh~		Scope
03197.sh		AudioScope.txt		URL
03220.sh		BW_HELP			hexstring
03220.txt		Desktop			listing.txt
03240.sh		Documents		sox-14.4.0
AMIGA:barrywalker~> _

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

cannot determine current directory

Hi, when I execute some simple commands on my solaris system, I am getting the following warning message: Could anybody tell me what could be the reason Ex:- If I give the command, which ls Warning: cannot determine current directory ... (15 Replies)
Discussion started by: axes
15 Replies

2. Shell Programming and Scripting

filename in current directory

I want to perform a task on all the files in the current directory but I'd like to loop through them one at a time. How do I tell it to give me the first filename? (2 Replies)
Discussion started by: calgone337
2 Replies

3. Shell Programming and Scripting

Finding files in current directory when 100,000's files in current directory

Hi All I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age. I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies

4. UNIX for Dummies Questions & Answers

How to compare current time with the input to variant?

Hi all, I have a simple script follow: ------------- #!/bin/bash echo -n " Enter the date of today: " read dateoftoday ------------- Now I want to compare the variant $dateoftoday with date of the system (now) in order to prevent user inputs the past date to $dateoftoday. I want to make... (3 Replies)
Discussion started by: axn_boy
3 Replies

5. Shell Programming and Scripting

tarball of current directory

I wanna make a backup tarball. I wanna write a script that makes tarball of the current directory. There are lots of files so I cant type all files, I wanna make the tarball by excluding few files. Like there 1000 files in a directory I wanna create a tarball containing 98 files of that... (1 Reply)
Discussion started by: nishrestha
1 Replies

6. HP-UX

Unable to Set Prompt to current working DIR

HPUX does not recognise \h,\w,\u to display the hostname,working directory and username respectively. So how do i set the PS1 variable to display my current working Directory as my prompt? I also tried PS1=$PWD, But it keeps showing the same directory path as prompt which PWD was holding at... (3 Replies)
Discussion started by: Amit Kulkarni
3 Replies

7. UNIX for Advanced & Expert Users

current directory in awk

Hello, I want to use the string with the current directory in my awk command. I tried: 'pwd=system("pwd")' but it doesn't work. can please help somebody? (2 Replies)
Discussion started by: daWonderer
2 Replies

8. Shell Programming and Scripting

Need to delete large set of files (i.e) close to 100K from a directory based on the input file

Hi all, I need a script to delete a large set of files from a directory under / based on an input file and want to redirect errors into separate file. I have already prepared a list of files in the input file. Kndly help me. Thanks, Prash (36 Replies)
Discussion started by: prash358
36 Replies

9. UNIX for Dummies Questions & Answers

How to email the current directory?

Hi, I'm very new to Unix, but have been given a command to type in which is : mail -s <email subject goes here> <my email address> <success.txt this command is quite a basic one and sends an email containing the contents of the file "success.txt" to whatever email I put in with the subject of... (2 Replies)
Discussion started by: rnmuk
2 Replies

10. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies
EXO-OPEN(1)							 Xfce Users Manual						       EXO-OPEN(1)

NAME
exo-open - Open URLs and launch preferred applications SYNOPSIS
exo-open [[url]...] exo-open --launch [category] [[parameter]...] DESCRIPTION
exo-open is a command line frontend to the Xfce Preferred Applications framework. It can either be used to open a list of urls with the default URL handler or launch the preferred application for a certain category. INVOCATION
exo-open either takes a list of URLs and tries to open each of them using the default handler, or, when using the --launch tries to launch the preferred application for a certain category, optionally passing any number of parameters to the application. Options -?, --help Print brief help and exit. -v, --version Print version information and exit. --working-directory directory When using the --launch option and this option is specified as well, the application will be run in the given directory. This is primarily useful when running the preferred TerminalEmulator from another application and you want the command in the terminal window to be run in a specific directory. --launch category parameters... Launch the preferred application for the given category with the optional parameters..., where category is either WebBrowser, MailReader, TerminalEmulator or FileManager. If you do not specify the --launch option, exo-open will open all specified URLs with their preferred URL handlers. Else, if you specify the --launch option, you can select which preferred application you want to run, and pass additional parameters to the application (i.e. for TerminalEmulator you can pass the command line that should be run in the terminal). COMPOSING EMAILS
exo-open allows users and developers to open the preferred email composer from the command line by simply invoking exo-open mailto:USER@HOST.TLD. This will open the composer window with USER@HOST.TLD as the recipient. This syntax is supported by all MailReaders. In addition the MailReaders that ship as part of libexo also support extended mailto:-URIs (but be aware that user-defined mailers do not necessarily support this), which allows you to also specify default values for the subject and the body of the mail, add additional recipients (both Cc: and To:) and attach files to emails. For example mailto:foo@foo.org?cc=bar@bar.org&subject=Foo&attach=/foo/bar.txt tells the composer to start an email to foo@foo.org and bar@bar.org with Foo in the subject and the file /foo/bar.txt attached to the message. AUTHOR
exo-open was written by Benedikt Meurer benny@xfce.org. This manual page was provided by Benedikt Meurer benny@xfce.org. Xfce 06/10/2011 EXO-OPEN(1)
All times are GMT -4. The time now is 08:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy