bash aliases and command chaining with ; (semi-colon)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash aliases and command chaining with ; (semi-colon)
# 1  
Old 11-30-2010
[SOLVED] bash aliases and command chaining with ; (semi-colon)

What am I doing wrong here? Or is this not possible?
A bug?

alias f='find . >found 2>/dev/null &'

f ; sleep 20 ; ls -l
-bash: syntax error near unexpected token `;'

Last edited by star_man; 11-30-2010 at 02:41 PM.. Reason: solved
# 2  
Old 11-30-2010
Just use parenthesis, if you want to run a command in the background:

Code:
alias f='(find . >found 2>/dev/null &)'
f ; sleep 20 ; ls -l

# 3  
Old 11-30-2010
That did it, thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete all lines without a trailing semi colon

shell : bash os : RHEL 7.2 I have a file like below 61265388 1-11Y5C-7690 1-11Y4Q-6763 INSERT INTO emp VALUES('oramds:test.xref','CBS_01','MIGWO161265388','61265388','N',SYSDATE); INSERT INTO emp VALUES('oramds:test.xref','COMMON','MIGWO161265388','MIG1COMMON61265388','N',SYSDATE);... (3 Replies)
Discussion started by: kraljic
3 Replies

2. Shell Programming and Scripting

awk unique count of partial match with semi-colon

Trying to get the unique count of the below input, but if the text in beginning of $5 is a partial match to another line in the file then it is not unique. awk awk '!seen++ {n++} END {print n}' input 7 input chr1 159174749 159174770 chr1:159174749-159174770 ACKR1 chr1 ... (2 Replies)
Discussion started by: cmccabe
2 Replies

3. Shell Programming and Scripting

awk does not find ids with semi-colon in the name

I am using awk to search $5 of the "input" file using the "list" file as the search criteria. So if the id in line 1 of "list" is found in "search" then it is counted in the ids found. However, if the line in "list" is not found in "search", then it is outputted as is missing. The awk below runs... (3 Replies)
Discussion started by: cmccabe
3 Replies

4. Shell Programming and Scripting

[BASH] Getting a semi-tailing backslash when passing (escaped) variables to script

Heyas Figured me had a 'typo' in tui-conf-set, i went to fix it. Now, i also figured, it might be nice to have tui-conf-set report (to console, not only exit code) wether it could save the variable to the file or not. This said, I appended this code: (the tui-title and tui-echo lines are... (3 Replies)
Discussion started by: sea
3 Replies

5. Homework & Coursework Questions

C++ Attempting to modify this function to read from a (;) semi-colon-separated file

After some thought. I am uncomfortable issuing my professors name where, there may be unintended side effects from any negative responses/feedback. Willing to re post if I can omit school / professor publicly, but can message moderator for validation? I am here for knowledge and understanding,... (1 Reply)
Discussion started by: briandanielz
1 Replies

6. Shell Programming and Scripting

Bash, remove numbers after colon

Hello All, I was wondering if someone might know how to do this. I have a word list that is format like the example below. I need to take away the :number after that... is there some kind of command I could use to remove them? 123456:5562 password:1507 123456789:989 qwerty:877... (7 Replies)
Discussion started by: 3therk1ll
7 Replies

7. Shell Programming and Scripting

Need a script to convert comma delimited files to semi colon delimited

Hi All, I need a unix script to convert .csv files to .skv files (changing a comma delimited file to a semi colon delimited file). I am a unix newbie and so don't know where to start. The script will be scheduled using cron and needs to convert each .csv file in a particular folder to a .skv... (4 Replies)
Discussion started by: CarpKing
4 Replies

8. Shell Programming and Scripting

[Solved] BASH - chaining TEST and COMMAND with && and II

Can you explain what this line of script is doing. What I have understood is : -- variable C is the name of a software which is either not installed, so it must be installed or allready installed and then should be update if newer version found -- branch B="$B $C" is to install the software --... (4 Replies)
Discussion started by: jcdole
4 Replies

9. Shell Programming and Scripting

Running multiple commands stored as a semi-colon separated string

Hi, Is there a way in Korn Shell that I can run multiple commands stored as a semi-colon separated string, e.g., # vs="echo a; echo b;" # $vs a; echo b; I want to be able to store commands in a variable, then run all of it once and pipe the whole output to another program without using... (2 Replies)
Discussion started by: svhyd
2 Replies

10. Shell Programming and Scripting

[SOLVED] how to use my aliases in a bash script

Hi, I confess to be stuck ... as explained here Aliases - Bash Reference Manual I added shopt -s expand_aliasesto my script ... but it didn't work. Later I've read I had to add this at the begning of my my script : . ~/.bash_aliases(of course my aliases are in this file) but again, the... (0 Replies)
Discussion started by: xib.be
0 Replies
Login or Register to Ask a Question